Python-jenkins
跳到导航
跳到搜索
Example 1: Get version of Jenkins
This is an example showing how to connect to a Jenkins instance and retrieve the Jenkins server version.
import jenkins server = jenkins.Jenkins('http://localhost:8080', username='myuser', password='mypassword') user = server.get_whoami() version = server.get_version() print('Hello %s from Jenkins %s' % (user['fullName'], version)) #Hello 运维 from Jenkins 2.263.1