0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Jenkinsでビルドした成果物をArtifactoryにPushする

Posted at

JenkinsにArtifactoryサーバーを設定

Jenkins上で「Jenkinsの管理」⇒「システム設定」からArtifactoryサーバーを設定
image.png

ここで設定されたServer IDをJenkinsfileで使用します。

Jenkinsfileを作成

各種ビルドをした次のstageでArtifactoryへのPushを記述します。

stage('publish') {
      steps {
        rtUpload (
            serverId: 'artifactory',
            spec: '''{
                "files": [
                    {
                        "pattern": "target/***.jar",
                        "target": "Your repository"
                    }
                ]
            }'''
        )
        cleanWs()
      }
    }
  }

Server IDは先程Jenkinsに登録したIDを指定します。
patternにはビルドによって生成されたPushすべきモジュールのパスを指定します。
targetはArtifactoryのリポジトリのパスを指定します。ビルド時に受け取った変数などを指定することでPush先を切り替えることも可能です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?