How can I test a change made to Jenkinsfile locally?

You cannot execute Pipeline script locally, since its whole purpose is to script Jenkins. (Which is one reason why it is best to keep your Jenkinsfile short and limited to code which actually deals with Jenkins features; your actual build logic should be handled with external processes or build tools which you invoke via a … Read more

Export/import jobs in Jenkins

Probably use jenkins command line is another option, see https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI create-job: Creates a new job by reading stdin as a configuration XML file. get-job: Dumps the job definition XML to stdout So you can do java -jar jenkins-cli.jar -s http://server get-job myjob > myjob.xml java -jar jenkins-cli.jar -s http://server create-job newmyjob < myjob.xml It works … Read more

How do I schedule jobs in Jenkins?

By setting the schedule period to 15 13 * * * you tell Jenkins to schedule the build every day of every month of every year at the 15th minute of the 13th hour of the day. Jenkins used a cron expression, and the different fields are: MINUTES Minutes in one hour (0-59) HOURS Hours … Read more

Docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

If using jenkins The user jenkins needs to be added to the group docker: sudo usermod -a -G docker jenkins Then restart Jenkins. Otherwise If you arrive to this question of stack overflow because you receive this message from docker, but you don’t use jenkins, most probably the error is the same: your unprivileged user … Read more

How to restart Jenkins manually?

To restart Jenkins manually, you can use either of the following commands (by entering their URL in a browser): (jenkins_url)/safeRestart – Allows all running jobs to complete. New jobs will remain in the queue to run after the restart is complete. (jenkins_url)/restart – Forces a restart without waiting for builds to complete.

tech