如何通过一键生成 App 加速企业数字化转型?
838
2022-11-30
Nexus 06 使用Jenkins nexus 插件发布制品
拿到制品的核心就是定位制品,仓库URL+GroupID+ArtifactId+Version就可以定位一个制品
使用Jenkins插件发布制品
发布其实就是-制品,然后将制品发送到目标主机,最后通过脚本或者指令启动程序。
下面是-制品的示例:
curl -o app.jar -uadmin:admin123
现在我要用插件列出这个制品不同的版本,并且赋值给变量artifatUrl
安装Maven Artifact ChoiceListProvider (Nexus)插件, 可以使用该插件列出包列表。
后面又上传了不同版本的制品,这里可以列出不同的版本,并且对其排序。
String artifactURL = "${env.artifactUrl}".toString()pipeline { agent any stages { stage('Hello') { steps { println("The artifact url is: ${artifactURL}") sh "wget ${artifactURL} && ls" } } }}
Started by user adminRunning in Durability level: MAX_SURVIVABILITY[Pipeline] Start of Pipeline (hide)[Pipeline] nodeRunning on build-01 in /data/cicd/jenkinsagent/workspace/nexus/nexus-chajian-download[Pipeline] {[Pipeline] stage[Pipeline] { (Hello)[Pipeline] echoThe artifact url is: sh+ wget 09:10:48-- to 139.198.166.235:8082... connected.HTTP request sent, awaiting response... 200 OKLength: 17063797 (16M) [application/java-archive]Saving to: ‘devops-lib-6.6.6.jar’ 0K .......... .......... .......... .......... .......... 0% 286K 58s 50K .......... .......... .......... .......... .......... 0% 395K 50s.................................................................................... 16550K .......... .......... .......... .......... .......... 99% 264K 0s 16600K .......... .......... .......... .......... .......... 99% 276K 0s 16650K .......... ... 100% 502K=46s2021-11-25 09:11:35 (360 KB/s) - ‘devops-lib-6.6.6.jar’ saved [17063797/17063797]+ lsdevops-lib-6.6.6.jar[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineFinished: SUCCESS
-制品
cURL
curl -u admin:admin123 -o anyops-devops-service-1.1.1.jar
Wget
wget ----http://192.168.1.200:8081/repository/anyops/com/anyops/anyops-devops-service/1.1.1/anyops-devops-service-1.1.1.jar
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~