原文连接:http://www.duozhi.online/2023/10/18/jenkins%e9%9b%86%e6%88%90artifactory/
jenkins安装: http://www.duozhi.online/2023/10/12/jenkins%e5%ae%89%e8%a3%85/
artifactory安装:http://www.duozhi.online/2023/10/12/artifactory%e5%ae%89%e8%a3%85/
artifactory中新增repo
jenkins中安装插件
jenkins配置pipeline
pipeline内容如下
def rtServer = Artifactory.server "myjfrog"
def gradleUpload = """{
"files": [
{
"pattern": "/home/lili/lili.txt",
"target": "test/",
"flat": "true"
}
]
}"""
pipeline {
agent any
stages {
stage('SayHello') {
steps {
script{
echo "Hello step start------------------------"
rtServer.upload(spec: gradleUpload)
}
}
}
}
}
查看jfrog中,文件已经上传进来了