how to update active build in google cloud services? - go

The project I'm working on uses Google Cloud Services with Firebase. We have some services that run on Google Cloud Run. I cloned a Golang repo and made a small modification to a struct which is a dependency for couple of the Cloud Function Triggers.
I am attempting to get this new code running on the cloud but seem to be missing something. I did the following command:
gcloud builds submit --config ./cloudbuild.yaml .
which completed successfully. I now have that build showing in Google Cloud Builds, however I am unsure of how to make that the active build.
Where do I set this build to be the active build?

You don't need to worry about activating it. Once you run the command gcloud builds submit, you have already created the build and it's active in your builds. So, you don't have to set this build as the active build or anything like that, as it's already in your platforms. This works like this as you can have many active builds in your platform.
In case you want to check your build details, you can access your Cloud Build page, select your project and click Open. Once there, just click on a particular build so you will see the Build details page. To view the artifacts of your build, under Build Summary, click Build Artifacts.
In addition to that, if you have more doubts in general on how to use Cloud Build and how it works, this tutorial Serverless CI/CD —Cloud Build has all the details about it.

Related

How Google Cloud build works?

I am new to Google cloud build, I want to build an application which runs on Windows server. I am not using any containerized application for webhosting.Is it necessary build steps written in cloudbuild.yaml to run on container, as most of the examples I saw from Google doc's for dockerized build. If not please let me know how can I do that.
All build steps are containers that are executed as part of your pipeline, so your build itself is a containerized tool chain. However, you need not build containers -- you can build jars, pars, zip files, and anything else you might want. Export these artifacts yourself in a build step or declare them as artifacts.

Bitbucket Pipelines - Is there a way to see a build monitor?

We are starting to use Bitbucket Pipelines after previously using Jenkins as our CI server.
The only thing that's missing now is a build monitor, something similar to the Jenkins Build Monitor seen here: link
Does anyone know of an equivalent for Pipelines? I suppose I could always create my own using the Bitbucket Repositories API and an open source build monitor framework like this, but I'd rather not do that unless I have to.
Thanks!

how to set up a Appium UI test maven project to work with Gitlab CI to test Android App?

I am an intern now, new to automation test.My goal here is to help my company set up CI for client side.
Right now I have a maven project contains several tests using Appium java-client lib, under Eclipse IDE, which could run the UI tests locally. My goal next step is to hook my tests with the gitlab repo(which is already there, created by the android developers), but I am stuck here. Could somebody help me out?
Please try to be specific:
how should I set up the .gitlab.yaml?
can we just have the script in yaml to download Appium and maven?
or we could just download Appium, but import all the Appium java-client jars to libs in main?
If either of above is true, how? if neither, what and how should I
do?
Where should I put my test in gitlab in that repo? Or I don't have to
put my tests in the existing repo. Instead, I could have another one
and tell yaml where to reach? Again, how?
It will be helpful if you could help me go through the workflow.
Like, when I developers check in code, gitlab read the yaml, then
build, then find my test suits in where(Q3), then execute etc.
Many thanks in advance!
Since finally someone is also interested in this question, let me share my solution to this.
So, if you are looking at this question, I assume you already have your test suite and you could test it locally in your machine, either have your app installed in a simulator or a real device. Now you need to read more about gitlab pipeline and gitlab CI :
pipeline: https://docs.gitlab.com/ee/ci/pipelines.html
gitlab CI: https://docs.gitlab.com/ee/ci/quick_start/
And you should have noticed that, one of the advantages of Appium is that you don't need to change a thing about the App you are testing, you are testing exactly the same App which is going into production. To learn more about Apppium:
http://appium.io/docs/en/about-appium/intro/
Now, to run the automation test, you need your test suite, the app, and Appium server. What we need to do is adding another stage in .gitlab-ci.yml, tell it to
take the newly compiled App, compile your test suite
install the App in simulator/real device
compile your test suite and run it.
To make things easier to understand, we start with question 4, workflow:
So when the code is checked in to gitlab, the gitlab runner runs the jobs of each stage in your .gitlab-ci.yml, and when it runs to your stage, it does the automation test, and note that it is running on your server, so it means you need to have Appium installed on your server and have it up and running when try to run your automation test suite. Now the problem is that, is your server capable to do so? If you wanna do the automation test in your server, you need to install Appium on it, simulator probably(and which might need your server to equip with GPU), etc, these are the concerns of maintaining server. The alternative would be using the third-party service ,which is what I did. Turns out our(when I was in that company) server isn't capable of running automation UI test, so we turned to AWS-ADF(Amazon Device Farm), there are many other service providers you could choose, see the link for references:
https://adtmag.com/blogs/dev-watch/2017/05/device-clouds.aspx
So I basically have a python script in my functional test stage, and it will grab the newly complied App, the automation test suite, upload them to AWS ADF, and then schedule a run, yields result when the run is finished.
so, to answer question 1:
we need to create one more stage for our functional test in .gitlab.yaml, in my case, I have a stage functionalTest_project stage after the stage which compiles the Android App. And then you script the necessary cmd in your stage, or if its too lengthy, your script in another file(put it in your repo) and then execute it. In my case, I put my script in python_ci.py, and then I execute it in my stage use “python python_ci.py” .(here you need a docker with these requirement, see below too)
You don’t download Appium, you set up Appium on your or if you use a cloud service, that service should set up Appium for you.
What I did it is that I use maven built and package the test suite locally and then push it to gitlab repo, which now I believe the better way would be compile and package it in the your functionalTest stage in .gitlab.yml. now it comes back to first point of question 1, how to get maven, my understanding is that its a dependency of the server, like python, so they could both be obtained by telling gitlab to execute your script with a docker that has python and maven dependency.
answer to question 3:
put it in the same repo, but out of the Android project(i.e. they will under the same directory).
how to tell yml to reach the test suite? remember they are in the same server, so you could the relative path in your yml script to tell yml where to get your test suite.
Hope this helps!

TeamCity create new bug in youtrack

I am using TeamCity and YouTrack.
I would like when build fails in TeamCity to be automatically created bug in my youtrack system, same way as TFS does.
After registering YouTrack with TeamCity but this does not work for failed builds just gives me.
Any idea how to do this?
I'm not sure there is straight out of the box functionality to do what you require.
But after reading some information, what you could do is setup a build that has a "Finish Build" trigger that would always execute after your first build finishes. (Regardless of success or failure).
Then in that second build, you could use the TeamCity REST API to determine if the last build execution from the first build was successful or not. If it wasn't successful then you could use the YouTrack REST API to create the issue.
TeamCity API Here: http://confluence.jetbrains.com/display/TW/REST+API+Plugin
YouTrack Create Issue API Here: http://confluence.jetbrains.com/display/YTD4/Create+New+Issue

Jenkins- multiple locations SVN. Is it possible to specify the build version

I am new to Jenkins CI tool and I want to know if it is possible to specify what build to use when there are several projects, on different SVN locations, dependent on one another. For example, if I have the web project on SVN location1 and the backend project on SVN location2 and the web depends on the backend and one of the developers modifies something in backend, when the web developer does a commit, there will be a build failure. Is there the possibility to specify that the build from the web part should take into consideration build x from backend and not the newest build?
Thanks in advance.
yes that can be done. in Jenkins check for the Build Triggers options in your project web-settings and on the line Build after other projects are built you can specify the name of projects you want to build automatically after there has been changes made to the base project.
And similarly, in the Post-build Actions, look for Build other projects, where you can specify that if the base project builds successfully, it will automatically trigger a build on children projects.
Hope this helps.
Your example of building a project against a specific version of another project is a little non-standard, but not impossible.
In your case, I would use Jenkins' ability to execute arbitrary scripts to help. The script would take care of getting the correct version of the project that the one I want to build depends on.
Building on your example of a Web and Backend project, here's how I would do things without using a parametrized build:
Add a file to the repository of the Web project that stores the version of the Backend project to use
Configure a job to build the Web project when the source for the backend project changes in SVN.
The project should check out the latest version of the Web project
The first Build Step for the project would be a script (Execute Shell or Execute Windows Batch Command) that does the following:
Gets the version of the Backend to use from the file containing the version info
Either pulls the appropriate version of the Backend from the Backend's repository; or pulls the source of the appropriate version of the Backend's source
(If you pulled the source only for the Backend, the next Build Step should be to build the Backend next)
Build the Web piece
Do any unit tests

Resources