Hot answers tagged

42

Figured it out. Outside of any stages (otherwise this will just end the particular stage as a success) do the following; if( $VALUE1 == $VALUE2 ) { currentBuild.result = 'SUCCESS' return } return will stop the stage or node you're running on which is why running it outside of a stage is important, while setting the currentBuild.result prevents it ...


34

Luckily there is a hudson.util.Secret.decrypt() function which can be used for this, so: In Jenkins, go to: /script page. Run the following command: println(hudson.util.Secret.decrypt("{XXX=}")) or: println(hudson.util.Secret.fromString("{XXX=}").getPlainText()) where {XXX=} is your encrypted password. This will print the plain password. To do opposite,...


32

There are many ways to do this but the easiest way I can think is doing a backup of the Jenkins Home folder. You can see where is your Jenkins home with: echo $JENKINS_HOME And for example, if you only want to backup the jobs you can go to: cd $JENKINS_HOME/jobs And make a backup for that folder. All that configuration will be a bunch of XML files. If ...


29

All jobs (jobs/) and master config files (config.xml) can be found in Jenkins home folder (JENKINS_HOME) in the following structure: JENKINS_HOME +- config.xml (jenkins root configuration) +- *.xml (other site-wide configuration files) +- userContent (files in this directory will be served under your http://server/userContent/) +- ...


18

It supports AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC. For all of them exists a plugin and as you probably already know, Jenkins is not limited to only that list, anyone can create a SCM plugin for other options if they want to. Here is the link to the plugins: AccuRev: https://wiki.jenkins-ci.org/display/JENKINS/AccuRev+Plugin ...


17

Yes, definitely. I do this all the time. You can specify configuration options for your pipeline and one of them is skipDefaultCheckout, which causes pipeline to skip the default "Declarative: Checkout SCM" stage. The skipDefaultCheckout option is documented in Pipeline Syntax and here's an example Jenkinsfile showing how to use it: pipeline { agent { ...


15

Spotted an open source tool called autospotting that just might help with this: Once enabled on an existing on-demand AutoScaling group, it launches an EC2 spot instance that is cheaper, at least as large and configured identically to your current on-demand instances. As soon as the new instance is ready, it is added to the group and an on-demand ...


14

Yes, it is possible. In Windows, this is what I see when there is a new version available: When you click the Upgrade Automatically button, Jenkins downloads and install the new war file itself. Please, check Jenkins wiki for further details. There are some problems if you installed Jenkins from a Debian package. If you run Jenkins with java -jar ...


14

Number of commits. Jenkins is a fork of Hudson (as commented here) but has a more active development, Hudson's last commit is quite old. And look at Hudson's open bugs


14

Managed to solve it with the following code: pipeline { agent { label "master"} stages { stage('1') { steps { script { def tests = [:] for (f in findFiles(glob: '**/html/*.html')) { tests["${f}"] = { node { ...


12

In general, there are five main differences between different CI software solutions. Cost: Is the software open source and free or proprietary? Does your DevOps team already have a budget for software or are you expected to compare free options? Maintenance: Is the software something you need to host on your own and maintain, or is it being offered as a ...


12

So after a debug session in chat what is needed is to allow the user running jenkins to be able to sudo docker passwordless on the docker host. A typical sudoers file on ubuntu could be in /etc/sudoers.d/jenkins jenkins_user ALL=(ALL) NOPASSWD:ALL Be warned this allow jenkins_user to run as root without password any command, a better file should be: ...


12

Any one facing the same problem and using pipeline project, set JENKINS_NODE_COOKIE instead of BUILD_ID. Dont waste your time setting HUDSON_COOKIE, HUDSON_SERVER_COOKIE, JENKINS_COOKIE or JENKINS_SERVER_COOKIE. None of them work for pipeline project. Refer to https://issues.jenkins-ci.org/browse/JENKINS-28182 for more details.


12

If you navigate to $YOUR_JENKINS_URL/updateCenter/ you should see the following page: Here you can check Restart Jenkins when installation is complete and no jobs are running which should be fairly safe.


12

Visiting https://youjenkinsdomain/safeRestart will set it in the mode when it waits for jobs to stop and then restarts.


11

If your Jenkins jobs are defined in a Jenkinsfile you can store it in a git repository and have it loaded up by using Pipeline. Unfortunately, since not all Jenkins plugins support Jenkinsfile and Pipeline, you will need to manually create new Jenkinsfiles if you wish to move existing jobs to this format.


11

Have a look at the Summary Display plugin. Some more details about it (= quote from the linked page): ... allows an easy and fully customized build report display. Features Allow a rich summary report visible from both project and build page Reports must be written in an XML format according to the syntax described in section Syntax ...


11

The Jenkins website has a blog post on this issue: But one issue, which we feel is the most significant issue of all, one for which we now believe no resolution is possible: the rights to the name Hudson. Oracle has told us that they have trademark applications filed in both the EU and US for Hudson, based on Hudson's creation by Kohsuke while ...


11

The "Embeddable Build Status Plugin" will do exactly that. Note: This requires your Jenkins server to be accessible from the internet if you're using GitHub because they cache all images in their CDN.


11

There are no fundamental technical issues with running multiple jenkins slaves on the same machine. In fact Running Multiple Slaves on the Same Machine lists several good reasons for doing it: While the correct use of executors largely obviates the need for multiple slave instances on the same machine, there are some unique use cases to consider: ...


11

As you guessed, build not necessarily means "compile". Building is a process of creating software from sources, which might include stuff like gathering dependencies, compiling, archiving, transforming code in any way, but also testing, deploying to different environments and promoting the artifacts between them.


10

Is there any other viable solution, maybe better than the ones above :) ? For Jenkins probably no, due to the license issues you mentioned (you have to run macOS on Apple branded hardware). If you can work with that then it's definitely a solution. If not, then I'd suggest you to check for a hosted iOS continuous integration system where you don't have to ...


10

https://wiki.jenkins.io/display/JENKINS/Jenkins+Best+Practices In larger systems, don't build on the master. If you have a more complex security setup that allows some users to only configure jobs, but not administer Jenkins, you need to prevent them from running builds on the master node, otherwise they have unrestricted access into the ...


9

The SCM Sync Configuration Plugin does exactly what you wish. Works with either svn or git to backup your jenkins core and job configuration, so gives you easy tracking as to who made changes, as well as a backup.


9

Based on the comments to my question, and some basic testing the following seems to work: Use nested parallel statements. (Thanks @lawnmowerlatte) Although today (May 15th 2017) Jenkins Blue ocean does not visualise this properly. Possible solutions discussed here


9

I'm posting this here not because I endorse these solutions (in fact, I've never tried them), but just because they are a potential answer to your question: You can start with JenkinsPipelineUnit, a unit testing framework for Pipeline scripts. There is also a project called jenkinsfile-runner which executes your Jenkinsfile in a transient, headless Jenkins ...


8

In addition to the list in the previous answer, there is also the plugin that integrates Serena Dimensions CM with Jenkins. Some more details about this plugin (from the linked page): The plugin allows a Jenkins job to be associated with a Serena Dimensions CM stream or project, automatically updating the Jenkins workspace with file content from the ...


8

Have a look at the Monitoring plugin. Here are some more details about it (from the linked page): Charts of memory, cpu, system load average, http response times by day, week, month, year or custom period Statistics of http requests with mean response times, mean cpu times, mean response size by request and by day, week, month, year or custom period ...


8

You can use a pipeline to tie the jobs together, executing them either in parallel or sequentially through steps. You can pass the relevant parameters to each job as you call it from the pipeline script. Then you just need to rebuild a single pipeline job. You can tie the jobs together with a common build name through a variable as well. build job: '...


8

You can install 'Bitbucket Server Webhook to Jenkins' in Bitbucket. https://marketplace.atlassian.com/plugins/com.nerdwin15.stash-stash-webhook-jenkins/server/overview Once install you will need to enable the 'Post Receive' Hook on the required repository. Remember to enable 'poll SCM' for the Jenkins Job. Update You can test the configuration of the ...


Only top voted, non community-wiki answers of a minimum length are eligible