操做系统:ubuntu 14.04.4 LTSjava
wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/war-stable/2.32.3/jenkins.war
Jekins有三种方式进行安装:python
下面介绍的是最后一种安装方式。须要至少Java7以上的(推荐Java 8)环境。 至少具备512MB内存。web
下载jenkins.war。(上面已经说明了)docker
经过SSH链接到ubuntu上,而后运行java -jar jenkins.war
ubuntu
Jenkins initial setup is required. An admin user has been created and a password generated. Please use the following password to proceed to installation:浏览器
b3ce86bc4ab64188bee4032f3845d113maven
This may also be found at: /root/.jenkins/secrets/initialAdminPasswordui
上面的密码会在下个步骤中使用。操作系统
最快的方式是,复制下面的例子到你的代码版本库中,并使用Jenkinsfile做为文件名。code
下面是针对Java语言的:
Jenkinsfile (Declarative Pipeline) pipeline { agent { docker 'maven:3.3.3' } stages { stage('build') { steps { sh 'mvn --version' } } } }
针对Python语言的:
Jenkinsfile (Declarative Pipeline) pipeline { agent { docker 'python:3.5.1' } stages { stage('build') { steps { sh 'python --version' } } } }