Jenkins API 使用示例——shell篇(2/2)

环境:Jenkins V2.150.1

获取所有job名称

命令:

1
2
3
4
5
# 获取crumb
crumb=$(curl -u "$jenkins_user:$jenkins_password" $jenkins_url/crumbIssuer/api/xml?xpath=concat\(//crumbRequestField,%22:%22,//crumb\))

# 获取job列表
curl -sX GET "$jenkins_url/api/json?pretty=true" -H "$crumb" -u "$jenkins_user:$jenkins_password" |grep '"url"' |grep '/job/' |sed -e 's@^.*job/\(.*\)/.*$@\1@'
阅读更多
Jenkins API 使用示例——shell篇(1/2)

环境:Jenkins V2.150.1

检测Job是否存在

命令:

1
curl -X POST [-H "Content-Type:application/xml"] "$jenkins_url/checkJobName?value=$job_name" --user "$jenkins_user:$jenkins_password"

其中,jenkins_password一般是使用jenkins_user的Jenkins API token,直接用密码也可以。

阅读更多
搭建Apache HTTP服务

系统:CentOS 7.2

更新EPEL源

🔗 What is Extra Packages for Enterprise Linux (or EPEL)?

Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL).

EPEL(Extra Packages for Enterprise Linux)是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS等提供高质量软件包的项目。

阅读更多