Hopefully this guide could help you have a better understand of Jenkins, and even be good at it.
Before we get started, it's important to figure out what Jenkins is.
Jenkins is an open-source automation server. It's a community driven project, and belongs to the Continuous deliver Foundation (aka, CDF). But it orinally came from Sun Microsystems.
From the technical perspective, it is written by Java. There are over 1800 plugins you could find from the community. Basically you will be able to the exsiting plugin to do what everything you want.
There are serval reasons that make it be worth to let you choose it.
- The community is very active, you could ask questions from multiple channels
- Forum, GitHub issues, Mailling list, or Chat
- Easy installation
- You could install Jenkins via: War package, Native package, Docker, Kubernetes, and more
- Easy configuration
- Almost all the configuration items have its description
- Plugins
- Extensible
- It's easy to use the plugin mechanism to extend Jenkins
- Distributed
- Jenkins can easily distribute work across multiple machines, helping drive builds, tests and deployments across multiple platforms faster.
Please make sure you have JRE 11 (Java Runtime Environment) or Docker. Your computer should has at least 1G memory, and 5G storage for the learing purpose.
There are four common ways to install Jenkins.
A simple command to run Jenkins from a single war file:
java -jar jenkins.war
A simiple command to run Jenkins in a container:
docker run -d -p 8080:8080 jenkins/jenkins:2.361.3-jdk11
See the official installation tutorial.
Task list:
- Create a free-style job, generate a file then archive it.
- Add a parameter for the job
- Set a job watch trigger
- Create a view
Task list:
- Understand the Syntax
- Be familiar with some important Pipeline steps
- Build and publish a Docker image with Pipeline
pipeline {
agent {
label 'java'
}
stages {
stage ('clone') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/devops-ws/learn-pipeline-java']]])
}
stage ('build') {
sh 'mvn clean package'
}
}
}
See the Pipeline syntax manual or the Snippet Generator.
Task list:
- Understand the git
- Create a GitHub multi-branch Pipeline
- Understand some important setting items
TODO
See also the official document.
TODO
TODO
TODO
Please visit the following links if you prefer other languages:
Language | Link |
---|---|
中文 | Bilibili |