Jenkins
Intro
My notes on the CICD tool
Documentation
Tips And Notes
- By default Jenkins will consider the build a failure if any command in the build step finishes with an exit value other than 0
- A red dot next to a build indicates it failed. Blue means it is all good.
Advantages
- Easy to use, web-based
- Built-in documentation with examples.
- Open Source
- MIT License
- Extensible through plugins
Installation
Jenkins can be run in all operating systems, and in Docker containers. Follow the instructions here: https://jenkins.io/download/
Azure Cloud
You can also find it as a template in the Azure marketplace : https://azuremarketplace.microsoft.com/en-us/marketplace/apps/azure-oss.jenkins?tab=Overview and instructions on how to use it here: https://docs.microsoft.com/en-us/azure/jenkins/
Install Via Docker Container
Pull the Jenkins image
docker pull jenkins/jenkins:lts
Run Jenkins and expose it on port 8080
docker run --detach --publish 8080:8080 --volume jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins:lts
Connects to the "Jenkins" container and executes the "cat <filename>" command to get the initial password. After this, you can connect to http://localhost:8080 and log in with the password shown. If you are inside a VM, make sure you use the browser in the VM and not your host. Alternatively, you can provide the VM's hostname followed by :8080 (eg, http://ubuntu1804lts:8080)
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
Install In Ubuntu
wget -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | apt-key add - echo "deb http://pkg.jenkins-ci.org/debian-stable binary/" | tee -a /etc/apt/sources.list apt-get update && apt-get upgrade -y apt-get -y install openjdk-8-jdk apt-get -y install jenkins cat /var/lib/jenkins/secrets/initialAdminPassword