How to get build number, build log url in buildbot? - buildbot

I am having buildbot master in one PC and slaves in other one. I need the buildbot build log url like (http://:8010/builders/xyz/builds/1) in slave PC for each build in an automated way.
Could someone help in getting the same.
Thanks in advance.

You can use build properties:
self.getProperty("buildnumber")
or, if you need to include it in a command:
d = WithProperties('%s','buildnumber')
command = ['echo', d]
Then the url will be: BUILDBOT_URL/xyz/builds/BUILD_NUMBER

Related

Azure Pipelines - "Label sources" fails without any useful diagnostics

Please, observe:
[Error]Failed to create ref refs/tags/dryrun-master-CI_64.0.0.25914-noat-test at 330dd52a89ed97f5dcd216bcf89e04b864247053.
[Error]Failed to create ref refs/tags/dryrun-master-CI_64.0.0.25914-noat-test at 330dd52a89ed97f5dcd216bcf89e04b864247053.
Created ref refs/tags/dryrun-master-CI_64.0.0.25914-noat-test at 330dd52a89ed97f5dcd216bcf89e04b864247053.
Running the build with the diagnostics does not actually produce any more output in this step.
The build url is https://dev.azure.com/Ceridian-dryrun/SharpTop/_build/results?buildId=1672629&view=logs&j=ca395085-040a-526b-2ce8-bdc85f692774&t=9ff468ea-e6fc-49e0-b3ce-f8332e9d6e3d, but I doubt it can be viewed by anyone.
I tried to reproduce it on a small repo, but apparently only this particular build is vulnerable.
How is one supposed to troubleshoot it? I am more than willing to inspect the source code of that task, but it is not amongst the tasks found in https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks. So, what can we do here?
Another weird thing - the duration of the step. It took 5 minutes to fail.

PactSwift how to build on CI

PactSwift:
we are unable to generate pact file while running on real time device, so we planned to generate pact file using CI.
Please share the information about how to generate and push the Pact file using CI.
The steps for the consumer pipeline are like this:
run consumer tests. You should know the exact command here
Make sure you understand where are pacts are located after the tests run
use PactBroker CLI to publish pacts to the broker: pact-broker publish ...
Make sure you know here: pact broker URL, the way how to call it (auth)
That's a first part, when provider part is ready ready about can-i-deploy and there is more

Where to put "FASTLANE_SESSION" value?

I'm using fastlane with Fastfile and Appfile
According this doc, i did create FASTLANE_SESSION variable in order to not enter a two-factor verification password every buildtime. But can't figure out where and how to put it to make it work. I don't use CI service, only fastlane in command line to deploy my ios build. Help please.
Run and follow the instructions: fastlane spaceauth -u some#email.com
When asked to copy the session, you can just say no. Fastlane will store it on your Mac.
You should really consider creating an API Key. Then you will avoid this.
Docs: https://docs.fastlane.tools/app-store-connect-api/#creating-an-app-store-connect-api-key
You need FASTLANE_SESSION available as an environment variable. If you're only running on command line you can do export FASTLANE_SESSION='<your-session>' and the next time you run the lanes that require the session should work.

Email upstream job artifact in jenkins

I have two jenkins jobs - JobA(upstream) and JobB(downstream). JobA generates the artifact TestReport.zip. I want to take TestReport.zip artifact in JobB and send it as an attachment in an email sent from JobB. I tried copy artifact plug in, but no luck. Can somebody please help with some steps how to do it?
Are you facing issue to passing TestReport.zip to Job B or facing issue to send email from Job B. I am assuming, you are facing issue to pass artifact to job B. As copy artifact plugin you tried and not worked, there is some alternative, you can try. So if both job A and Job B are running from same jenkins slave, then you can store artifact in some common place from where Job B can also access that and Job B can copy that from own workspace and initiate email using that as attachment. Please refer this article on how to pass parameter from one job to another.
https://itisatechiesworld.wordpress.com/jenkins-related-articles/jenkins-configuration/jenkins-passing-a-parameter-from-one-job-to-another/

GitLab CI - Project Build In Neverending Pending-State

I'm in some trouble with GitLab CI.
I followed offical guide on:
https://github.com/gitlabhq/gitlab-ci/blob/master/doc/installation.md
Everything was ok, no errors nowhere. I followed Runner-Setup, too.
Anything alright.
But...
When I add a runner to a project and then try to build nothing happens.
It could be that I have not fully understood something or some of my configs are wrong.
I'm absolutely new to GitLab CI, but I like it and I want to learn new stuff.
I would be very very glad if someone could help me in some way.
Thanks!
BIG UPDATE:
Just figured out that:
~/gitlab-runners/gitlab-ci-runner$ bin/runner
Starting a runner process manually solves the problem but if I look at the gitlab-ci-runner in /etc/init.d -> it is running !?!
~/gitlab-runners/gitlab-ci-runner$ sudo /etc/init.d/gitlab-ci-runner start
Number of registered runners in PID file=1
Number of running runners=0
Error! GitLab CI runner(s) (gitlab-ci-runner) appear to be running already! Try stopping them first. Exiting.
~/gitlab-runners/gitlab-ci-runner$ sudo /etc/init.d/gitlab-ci-runner stop
Number of registered runners in PID file=1
Number of running runners=0
WARNING: Numbers of registered runners don't match number of running runners. Will try to stop them all
Registered runners=1
Running runners=0
Trying to stop registered runners...kill: No such process
OK
Trying to kill ghost runners...OK
What's wrong here? I'm out of my power or not seeing the problem?!
Problem solved!
You need to edit some values in /etc/init.d/gitlab-ci-runner script!
APP_ROOT="**PATH_TO**/gitlab-runners/gitlab-ci-runner"
APP_USER="**USER_WITH_DIRRIGHTS!**"
PID_PATH="$APP_ROOT/tmp/pids"
PROCESS_NAME="ruby ./bin/runner"
RUNNERS_PID="$PID_PATH/runners.pid"
RUNNERS_NUM=1 # number of runners to spawn
START_RUNNER="nohup bundle exec ./bin/runner"
Now it works!
In my case tags in the runner were different from tags in the .gitlab-ci.yml. Once I changed them so runner tags include all of the config file tests, tasks began to run.