通常,为了获得最新成功构建的工件,我wget对以下URL进行了处理:
wget
http://jenkins.com/job/job_name/lastSuccessfulBuild/artifact/artifact1/jenkins.txt
有没有办法,我可以继续wget下去lastSuccessfulBuild并在build_id下面得到一个像?
lastSuccessfulBuild
build_id
build_id=`wget http://jenkins.p2pcredit.local/job/job_name/lastSuccessfulBuild`
是的,有一种方法,它非常简单:
$ build_id=`wget -qO- jenkins_url/job/job_name/lastSuccessfulBuild/buildNumber` $ echo $build_id 131 # that's my build number