jenkins安装
一、下载docker镜像 To use the latest LTS: docker pull jenkins/jenkins:lts To use the latest weekly: docker pull jenkins/jenkins 二、运行docker镜像 docker run -d -u 0 -p 8080:8080 -p 50000:50000 -v /data/jenkins_home:/var/jenkins_home jenkins/jenkins:lts 三、系统初始化密码文件 /data/jenkins_home/secrets/initialAdminPassword 四、python jenkins pip install python-jenkins 使用文档: http://python-jenkins.readthedocs.io/en/latest/examples.html#example-1-get-version-of-jenkins 创建任务 import jenkins server = jenkins.Jenkins(' http://localhost:8080 ', username='admin', password='passwd') job_xml = """<?xml version='1.0' encoding=