[JIRA] [git-client-plugin] (JENKINS-25389) Allow push of tags created during the build

4 views
Skip to first unread message

rollertone@gmail.com (JIRA)

unread,
Jul 1, 2015, 12:09:02 AM7/1/15
to jenkinsc...@googlegroups.com
Vito Andolini edited a comment on New Feature JENKINS-25389
 
Re: Allow push of tags created during the build
The help text for the "Add Tag" section of the "Git Publisher" Post-Build Action states:

bq. Specify tags to push at the completion of the build.
bq. If the "Create Tag" or "Update tag" option is selected, the tag will be created or updated and pushed at the completion of the build, and the push will fail if a tag with the given name already exists. If the "Create Tag" option is not selected, the push will fail if the tag does not already exist.
bq. *Environment variables may be used in the tag name - they will be replaced at build time.*
bq. The repository name needs to be one of the repositories configured in the SCM section above.
 
I have found that environment variables can be used in the tag message, but not the name. I don't understand why the plug-in would require the tag name to be hard-coded - who would go configure the job before each build to add a hard-coded tag name?
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

rollertone@gmail.com (JIRA)

unread,
Jul 1, 2015, 12:09:02 AM7/1/15
to jenkinsc...@googlegroups.com

The help text for the "Add Tag" section of the "Git Publisher" Post-Build Action states:

Specify tags to push at the completion of the build.


If the "Create Tag" or "Update tag" option is selected, the tag will be created or updated and pushed at the completion of the build, and the push will fail if a tag with the given name already exists. If the "Create Tag" option is not selected, the push will fail if the tag does not already exist.

Environment variables may be used in the tag name - they will be replaced at build time.


The repository name needs to be one of the repositories configured in the SCM section above.

I have found that environment variables can be used in the tag message, but not the name. I don't understand why the plug-in would require the tag name to be hard-coded - who would go configure the job before each build to add a hard-coded tag name?

marcello_desales@intuit.com (JIRA)

unread,
Oct 20, 2015, 11:19:07 AM10/20/15
to jenkinsc...@googlegroups.com

Hi there,

I'm coming from Node.js community... I use the following command when I finish a build: (https://docs.npmjs.com/cli/version)

  • Building Develop Branch:
Unable to find source-code formatter for language: sh. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
npm version prerelease -m "Upgrade by CI"

This will create a new commit, with a tag of the version increment for the current version, say, from 1.3.4, to 1.3.4-0. So, that can be ANY tag during the development cycle. Therefore, I also need to have the ability to publish ANY tag created by npm CLI.

thanks!

marcello_desales@intuit.com (JIRA)

unread,
Oct 20, 2015, 11:19:10 AM10/20/15
to jenkinsc...@googlegroups.com
Marcello de Sales edited a comment on New Feature JENKINS-25389
Hi there,

I'm coming from Node.js community... I use the following command when I finish a build: (https://docs.npmjs.com/cli/version)

* Building Develop Branch: 
 
{code:
sh java }

npm version prerelease -m "Upgrade by CI"
{code}


This will create a new commit, with a tag of the version increment for the current version, say, from 1.3.4, to 1.3.4-0. So, that can be ANY tag during the development cycle. Therefore, I also need to have the ability to publish ANY tag created by npm CLI.

thanks!

david.vangompel@gmail.com (JIRA)

unread,
Aug 17, 2016, 6:32:04 AM8/17/16
to jenkinsc...@googlegroups.com
David Van Gompel edited a comment on New Feature JENKINS-25389
For anyone who's interested, I've found a workaround:

1. Add something like this to your shell script:

{code:java}
#!/bin/sh
APP_BUILD_NUMBER=`npm version patch`
echo APP_BUILD_NUMBER=${APP_BUILD_NUMBER} > build.properties
{code}

2. then add build step *Inject environment variables* and set
there Properties File Path to `$WORKSPACE/build.properties`

3. after that, $APP_BUILD_NUMBER is accessible in all build steps as environment variable. Click `Add tag` in Git Publisher (Post-build action) and set tag to push to $APP_BUILD_NUMBER.
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

david.vangompel@gmail.com (JIRA)

unread,
Aug 17, 2016, 6:32:04 AM8/17/16
to jenkinsc...@googlegroups.com
David Van Gompel edited a comment on New Feature JENKINS-25389
For anyone who's interested, I've found a workaround:

1. Add something like this to your shell script:

{code:java}
#!/bin/sh
APP_BUILD_NUMBER=`npm version patch`
echo APP_BUILD_NUMBER=${APP_BUILD_NUMBER} > build.properties
{code}

2. then add build step* Inject environment variables *and set there Properties File Path to `$WORKSPACE/build.properties`


3. after that, $APP_BUILD_NUMBER is accessible in all build steps as environment variable. Click `Add tag` in Git Publisher (Post-build action) and set tag to push to $APP_BUILD_NUMBER.

david.vangompel@gmail.com (JIRA)

unread,
Aug 17, 2016, 6:32:04 AM8/17/16
to jenkinsc...@googlegroups.com

For anyone who's interested, I've found a workaround:

1. Add something like this to your shell script:

#!/bin/sh
APP_BUILD_NUMBER=`npm version patch`
echo APP_BUILD_NUMBER=${APP_BUILD_NUMBER} > build.properties

2. then add build step* Inject environment variables *and set there Properties File Path to `$WORKSPACE/build.properties`

3. after that, $APP_BUILD_NUMBER is accessible in all build steps as environment variable. Click `Add tag` in Git Publisher (Post-build action) and set tag to push to $APP_BUILD_NUMBER.

hassony@yahoo.com (JIRA)

unread,
Mar 17, 2017, 4:54:04 AM3/17/17
to jenkinsc...@googlegroups.com
Jon Has commented on New Feature JENKINS-25389

It was sure easier if this feature would exist.

Using the jgitflow:release-start/finish creates a tag in the build process, but doesn't push it to remote git.

This feature would make it easier instead of configuring git ssh with the jenkins machine + manually call git commands (because git commands requires password, which cannot be done in an automatic job)

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 13, 2020, 7:28:11 PM1/13/20
to jenkinsc...@googlegroups.com
Change By: Mark Waite
Status: Reopened Open
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages