Intro Jenkins

Intro Jenkins

這篇介紹Jenkins - The leading open source automation server,
Jenkins provides hundreds of plugins to support building, deploying and automating any project.

Intro Jenkins

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Jenkins provides users with a Web GUI to operate.

Jenkins plugin:
Jenkins provides thousands of plugins to meet your multiple needs.
https://plugins.jenkins.io/](https://plugins.jenkins.io/

What can you do in Jenkins:
- Build tomcat war
- Deploy tomcat war
- Use ansible
- Run shell script
- Check config with ansible

How to build Jenkins:
We use docker to build jenkins and use volume to keep config.
So it's easy for rebuild when your jenkins is dead and also easy for upgrade.

Build jenkins with docker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Pull docker image:
$ docker pull {url}

Create jenkins container:
$ docker run -itd --name jenkins -v jenkins:/var/jenkins_home --restart always -p {port}:8080 -e JAVA_OPTS=-Duser.timezone=Asia/Taipei -e TZ=Asia/Taipei -e LANG=en_US.UTF8 {url}

memo:
{port}:open up externally port number

Check your jenkins container:
$ docker ps -a

Open your browser and enter ip:port and you will see jenkins ask administrator password:

Use command to get administrator password:
$ docker logs jenkins

How to upgrade Jenkins:
$ docker stop jenkins
$ docker rm jenkins