詹金斯管道将Node + Gulp项目中产生的战争发布给Artifactory

时间:2019-12-24 12:35:11

标签: jenkins npm jenkins-pipeline artifactory

我有一个gulp build,它在war目录中创建了一个build文件。

是否有Jenkins管道将这个war文件直接发布到Artifactory。

请注意,我正在为詹金斯使用声明性管道

1 个答案:

答案 0 :(得分:0)

Jenkins的JFrog Artifactory plugin支持declarative pipelines
您可以使用rtUpload命令将文件上传到Artyifactory

rtUpload (
    serverId: 'Artifactory-1',
    spec: '''{
          "files": [
            {
              "pattern": "build/war/*.war",
              "target": "my-repo/my-path/"
            }
         ]
    }''',

    // Optional - Associate the uploaded files with the following custom build name and build number,
    // as build artifacts.
    // If not set, the files will be associated with the default build name and build number (i.e the
    // the Jenkins job name and number).
    buildName: 'my-build',
    buildNumber: '42'
)