Jenkins - OLD

OLD - THERE ARE BETTER WAYS

See the newer /posts/2022/02/12/jenkins-jenkinsfile-pipelines.html post.

To quote http://jenkins-ci.org/ jenkins is used to build/test software projects continuously and monitor executions of externally-run jobs.

Install

For example scripts to install jenkins on windows and ubuntu see https://github.com/majorsilence/DotNetDev/tree/master/DevOps/Jenkins.

Install on Ubuntu

Run the following with sudo.

echo "install jenkins"
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
rm -rf /etc/apt/sources.list.d/jenkins.list
echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
apt-get update
apt-get install -y --force-yes jenkins

Install on Windows

Download from http://mirrors.jenkins-ci.org/windows/latest and follow the instructions.

Configure after Install

Jenkins will be accessible at http://localhost:8080. Browse to it and configure however you want.

Security

If you want you can add security. An easy setup is:

Plugins

You will want to install a few plugins to use jenkins with most projects.

Browse to the plugin sections “Manage Jenkins -> Manage Plugins -> Available” and install

Those you will probably want with every install. Other plugins that are very useful include

Global Configure (eg. git, ssh, email, urls, credentials, etc.)

Browse to the Configure System section “Manage Jenkins -> Configure System”. Fill in your

Build Pipeline

It is easy to create multiple jobs that all each other. For example “Job 1 -> Job 2 -> Job 3”. You will want the “Parameterized trigger plugin”, “Copy Artifact Plugin”, and “Build Pipeline Plugin” installed.

On the dashboard create a new view. If the build pipeline is installed there is a “Build Pipeline View”, choose it and create your pipeline. Once the pipeline view is created you can add jobs to it.

To have one job call another job, the first job in the post build action add “trigger parameterized build on other project”. I generally like the following settings.