简体   繁体   中英

Jenkins Artifactory Plugin: Updating to the Latest Snapshot on Git

When we do a release, both the release artifact and tag are being created as expected. However, the project isn't properly updated to the next (snapshot) version.

An example configuration for the release:

在此输入图像描述

The relevant part of the console log:

[RELEASE] Committing release version on branch 'master'
[RELEASE] Creating tag '1.3.14'
[RELEASE] Pushing branch 'master' to 'ssh://git@git.cloudbees.com/xxx/yyy.git'
[RELEASE] Pushing tag '1.3.14' to 'ssh://git@git.cloudbees.com/xxx/yyy.git'
[RELEASE] Changing POMs to next development version
[RELEASE] Committing next development version on branch 'master'
Finished: SUCCESS

And the project's status in Git, as expected:

$ git pull origin master
From ssh://git.cloudbees.com/xxx/yyy
 * branch            master     -> FETCH_HEAD
Already up-to-date.
$ git show --summary
commit df10d905c24c1cbf8d0b6992ab366ac5dcba470b
Author: CloudBees DEV@Cloud <nobody@cloudbees.com>
Date:   Mon Jul 29 09:04:38 2013 +0000
$ git remote show origin
* remote origin
  Fetch URL: ssh://git@git.cloudbees.com/xxx/yyy.git
  Push  URL: ssh://git@git.cloudbees.com/xxx/yyy.git
  HEAD branch: master

    RELEASED 1.3.14

So it looks like the update to the next snapshot is being committed locally, but isn't being pushed. Is this a bug (I couldn't find a related ticket ) or are we doing something wrong?

PS: This problem only happens with Git, Subversion is working fine. Our Artifactory plugin version is 2.1.6, which should be the latest one.

SOLUTION: Choose the "Deploy Artifacts to Artifactory" post-build action. This is where the plugin does the missing final git push of the updated POMs, in addition to doing the actual artifact deployment.

WORKAROUND (In case you realy don't want to deploy your artifacts to Artifactory): Add a post-build action of "Git Publisher". I checked "Push Only If Build Succeeds". Then I clicked "Add Branch" and put "master" in the branch to push (because I had master in the git "Checkout to a specific local branch" box, per the plugin config page) and "origin" in the "Target remote name" block. This forced a push of the locally-committed updated POM.

It would be nice if the plugin did the final git push and publish to Artifactory automatically for maven without having to know to select the "Deploy Artifacts to Artifactory" post-build action, like it does for gradle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM