job generator jenkins plugin - plugins

I am currently working on a project where we use jenkins to automate jobs and process continuous integration. We use a job Generator to produce jobs, that will run tests on the specified branch as generator parameter.
I would like to add some build step to the job generator, to be processed while it is run, and not copied to the newly created job. Is there a way to do that ?
A workaround would be to create a job that will do the task i want to do and then run the job generator, but it looks ugly to me. Any other way ?
Thanks for your help.

You can create your additional step as a separate job and then use Multijob project to split the job and the generator into different phases, which will be processed sequentially. So first goes your 'additional step job', then job generations.

Related

Azure Pipeline Parallelism option

I am new to azure pipelines, started learning & in the process of creating my very 1st yaml pipeline.
My project is private, I am using a multi-stage templated pipeline, self-hosted as need to concurrently deploy a java web application to 7 VMs using mvn tomcat7 plugin run: command
so as to run selenium automation tests in parallel across all the VMs. A template pipeline which is called 7 times to deploy to all the VMs is such that it needs to stay running as
necessitated by the embedded tomcat instance on each of the VMs which in turn requires the ablitiy to have parallelism enabled, pay extra for to achieve this.
My question is; is there another way without having to pay extra for parallelism or turning my project to be a public one ?
I think what you want is parallel job. Only job could execute publish tasks in parallel.
And from this document, you could use parallel job freely when you change your project to public. And the job can run for up to 360 minutes(6 hours).
You need is that under Project Settings--> Overview--> change Visibility to public.
After that, under pipeline, add the publish task for each new agent job. So that, you could executes the publish task in parallel.

Is it possible to run Azure DevOps pipeline tasks in for loop using Classic UI?

I have pipeline that was configured using UI (not directly using yaml file). I have many different configuration variants and for each of these I have to run the same seperate Task in this pipeline. I found that it is possible using yaml file but could not find any information about UI approach. Thought that I might be able to run powershell task and run other tasks from there.
As of this time, however, running tasks in for loop using Classic UI pipeline is not supported. You need to add the tasks multiple times to let them run multiples times.
The good news is that you can use task groups to simplify this process.
A task group allows you to encapsulate a sequence of tasks, already defined in a pipeline, into a single reusable task that can be added to a pipeline, just like any other task. You can choose to extract the parameters from the encapsulated tasks as configuration variables, and abstract the rest of the task information.
Click Task groups for builds and releases for detailed steps.

Is it possible to have Jenkins workflows with an overlapping/shared stage?

This question concerns use of the Jenkins Workflow plugin and "synchronizing" a stage amongst independent jobs.
We have a generic workflow for multiple projects with steps:
build project
push project to test environment
run (long) end-to-end test suite
push project to production
Step 3 runs a long time. If multiple projects are built and pushed to the test environment within the same window of time, we'd like to only run once the end-to-end test suite.
Can we have the jobs some how synchronize on step 3?
The desired orchestration can be achieved by make Step 3 a build action. I.e.
build end-to-end-tests
Where end-to-end-tests is a job dedicated to running the slow end-to-end tests.
Adding a Quiet period to end-to-end-tests supports the goal of "collecting" projects updated within a time period to end-to-end test. That is, if project A and B are pushed to the test environment with Quiet period seconds, then end-to-end-tests runs only once.
JENKINS-30269 might be helpful, but your use case is indeed subtly different from the usual one that RFE would solve; you really seem to need a cross-job stage, which is not currently possible though in principle such a step could be written. In the meantime, a downstream deployment job is probably the most reasonable workaround.

Can a workflow be triggered from a post-build action of a freestyle project?

I have a Jenkins Workflow which I am able to run by clicking Build. But when I try to start it from the Build other projects post-build action of an (freestyle) project, I just get an error in the form
my-flow is not buildable
and the downstream flow is not run when the upstream project is built.
The post-build action Build other projects does not simply do what it sounds like: build those projects when the step is run. In fact running the step does nothing at all. Instead, it causes the named projects to be included in an edge of the dependency graph, and downstream projects according to the graph are then run according to separate logic. And currently the dependency graph API is defined in such a way that Workflow jobs cannot participate. Long story short, that mode does not work.
The Parameterized Trigger plugin offers other ways to start downstream jobs. The nonblocking trigger works much like the Jenkins core trigger: it affects the dependency graph. There is also a blocking trigger (which is a build step, not a post-build action), which just does what you probably expected: start the downstream build (much like the build step in Workflow). Currently this plugin does not support Workflow, though it would probably be easy to make it use more current APIs so that it would: JENKINS-26050
What does work is to configure the relationship in the reverse direction: in the Workflow job configuration, select Build after other projects are built and select your freestyle project. Now when the freestyle project finishes building, the Workflow job is triggered.

Trigger a build in Bamboo from a Jenkins job

Currently all our Regression tests are configured in a Jenkins job.We want once the regression tests are completed,it should trigger a plan in our Bamboo server and also record the tests results in Bamboo using TestNG parser.Is it possible?
Ps : I have already seen Bamboo rest-api but can not seem to find a solution.Any suggestions will be highly appreciated.Thanks
It hasn't been updated for a while and I'm not using it currently, thus can't confirm it is still working as desired (the download statistics suggest it being used though), but given there's not much to it, you should be able to achieve the first part of your use case with the Bamboo Notifier, which allows you to Trigger a Bamboo build upon successful completion of a Jenkins job.
The second part should be covered by the Bamboo TestNG Parser task, though you'll need to push your existing test result files to Bamboo by some means of course, possibly by Using the SCP task in Bamboo.