Template plugin for Jenkins - continuous-integration

Is there any plugin available in Jenkins which allows you to reuse shared configuration across the jobs.. e.g I can define a template for Continuous Integration and other template for Running Tests and create multiple jobs from these template for different branches.
I know template plugin is available in Enterprise Jenkins but is there something similar available for jenkins open source?
I am looking for something similar to
here

I have found ez-templates plugin to behave well for Jobs templating. It is very young project and you will have to build it by yourself (which is very simple, see below), but still it is much more powerful than Template Project Plugin as it supports any types of jobs.
How to build:
Install Maven 3
Clone/download the ez-templates git repo
Run 'mvn install' from the ez-templates checkout folder
Once build is ready go to the 'target' folder and find the ez-templates.hpi which is self contained plugin binary.

How about the Template Project Plugin?

The Job Generator Plugin was released after this question was asked, which may fulfil some people's needs.
Unfortunately the Template Project Plugin still has some issues, particularly in that it lacks support for job parameters.

We use the Jenkins job builder to automate creation and management of our jenkins jobs. It was basically built to allowing share configurations across jobs so you can easily create the same jobs with multiple configurations. Check it out: http://docs.openstack.org/infra/jenkins-job-builder

You can use the Copy Project Link plugin. https://wiki.jenkins-ci.org/display/JENKINS/Copy+project+link+plugin
What I have done is to create a disabled (dummy) pre-configured job and when I want to create another one with the same configuration I just copied by using this plugin.

Related

Can We create custom build feature in teamcity 10?

Right now we are uploading artifacts using udeploy cmd from Teamcity version 10. Can we create a custom build feature in teamcity for common tasks to avoid the manual stuff like
udeploy ??
common copy tasks
If it is possible, will be worthfull..
Thanks...!!
You can create a TeamCity meta-runner to encapsulate the uploading logic into a build step and configure it via a small set of parameters (if at all necessary).
If you need a build feature (which is much like build step, just you can add it in the template and do not need to manage the order of the build steps), this is possible via creating a TeamCity plugin which requires writing Java code.

Is there a way to specify several Jenkins files for the pipeline?

At the moment, we are generating Jenkins jobs using the Job DSL plugin. Typically, we have the following jobs per project:
CI build (SNAPSHOT build)
Deployment, one per stage
Integration test (nightly build)
Creation of a release
Reports (Maven site, during the night)
Am I right that there can be only one Jenkins file in the project's repository? How could I map our requirements to the new Jenkins pipeline?
I'm asking because we're going to install version 2 of Jenkins, and I'm not sure whether we should abandon our Jenkins job generation and use Jenkins files.
There are a couple of options, which might help you to migrate over to Jenkins pipelines. But you don't have to, especially not all at once.
You can use a shared library to define functions that can be used in multiple jobs, e.g. a buildOurThing function.
You can trigger an existing job (of whatever kind) using the build step. So you could model your new pipeline around existing jobs.
You can still use parameterized builds, if you want to use the deployment job with different targets.
Jenkins pipeline is really worth using, but maybe don't force you to an immediate switch. If JobDSL works for you, keep it. If you have new jobs (pipelines) to create, get familiar with pipelines.

Jenkins - Build, Deploy and Promote

Recently, I started learning how to use Jenkins CI. So I am a little bit of a noob at jenkins. I am about to start to try and do the following:
I have setup a maven multi-module job on jenkins, which builds, tests, and finally creates 4 seperate war applications. I archive the war artifacts as part of this job. These war files will only ever be built once, they contain multiple environment properties, and the war file along with each environments server will manage the profile it runs in, eg dev, test, staging, prod, etc
I have another job on jenkins which will deal with the deployment to multiple environments.
This second job, uses the copy artifact plugin, and uses a post build action to deploy to a dev environment.
The job in step 2 will hopefully be able to have multiple promotions, allowing deployment to multiple environments: test/staging/performance/production etc.
I have searched stackoverflow and google, and all the posts I see, always use the parameterized plugin, specifying a parameter for the environment. This means there is a seperate build for each env which I don't like.
Can anyone tell me if this is the right way to go? Or direct me to some tutorial on how to do this properly.
Looks like what you need is a matrix-project build.
P.S.
A good introduction to Jenkins could be found in Jenkins: The Definitive Guide
After playing around with the jenkins configuration. I have this working very nicely now.
In the deployment job, I didn't see the "Add another promotion process" button, which allows me to promote the same build to multiple environments manually or automatically.

Is it possible on TeamCity to build a module against all agents when a VCS Trigger is met?

I would like a module to be run by all agents when a VCS trigger condition is met.
Is this possible?
One way you can do this is by adding a Schedule Trigger which has an option to run on all agents.
Having looked into it, as far as I can see, not directly,
the behaviour could potentially be achieved by using the command line remote runner plugin,(http://confluence.jetbrains.net/display/TW/Command+Line+Remote+Run+Tool) through a seperate build configuration linked to the VCS to detect the changes, calling the Remote Run tool from a command line build step to build the project on each required agent.
Further research into the Command Line Remote Run tool would be required to confirm this is possible.
There may also be some functionality allowing this in the REST API, although my look through the documentation didn't show anything up.
Have you had much luck working on alternative solutions?
I've created a build configuration to update our source managed third party referenced assemblies directory and this is a snapshot dependency on most if not all build configurations. When I update this directory with a new or more recent assembly, I'll too would like this configuration to be run on all build agents.
At the moment, I've simply duplicated the configuration and bound each to a specific agent. It adds management overhead, but has temporarily resolved the issue.
You could install this plugin and specify the list of agent names and it will run once per "value" in the matrix.
https://github.com/presidentio/teamcity-matrix-build-plugin

Jenkins RequireJs Build / CI

I've just started a project that uses RequireJs, Backbone etc. Everything is running well client-side and I wan't to set up my build environment.
I was planning on using Jenkins but have found zero information on how to go about this. I've managed to set up Gradle and use that to do things like minify the js etc, but I think I need to run R.js and have no idea where to get started or if this is even what I should be doing.
I've googled a bunch and found nothing. Sorry for my ignorance.
Jenkins has a Gradle plugin: Gradle Jenkins Plugin
Installation
The plugin is very easy to install and use. To install it, just use the Jenkins web interface.
Manage Jenkins -> Manage Plugins -> Available Plugins -> Install
Search for Gradle, check the box and click install.
Create a job
Click new job. Select free style job and add a Gradle build step.

Resources