jenkins的docker持续集成
docker命令安装jenkins
docker pull jenkins/jenkins:2.277.2-lts-centos
docker run --name jenkins -d -v /home/jenkins_docker:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:2.277.2-lts-centos
docker logs containerId //查看容器实例id
231c8e9b5bc74a638a042e2947e243cb
df8dfa407934401d87f378a054e2b1f5
// 修改端口
vim /etc/sysconfig/jenkins
JENKINS_PORT="8080"
Manage Jenkins -> Script Console
def jobName = "Some_Job_Name"
def maxNumber = 64
Jenkins.instance.getItemByFullName(jobName).builds.findAll {
it.number <= maxNumber
}.each {
it.delete()
}