Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Git Publisher tag not picking up environment variables

Tags:

git

jenkins

I've been setting up my jenkins windows service to build all my projects, and have now got to the stage where I want jenkins to create a tag to indicate a successful build.

I'm attempting this as a post build step using the Git Publisher module.

My settings are as follows:

  • Push Only If Build Succeeds - Yes
  • Merge Results: No
  • Tag to push: %BUILD_NUMBER%
  • Create new tag: Yes
  • Target remote name: origin/master

The log file tells me that it's

Pushing tag %BUILD_NUMBER% to repo origin/master

and that is what I see within my git repository. I have tried other environment variables to no avail. The help says:

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

which isn't what I'm seeing. What I'm trying to achieve is that I push a tag which is named after the successful build number.

How can I achieve this?

like image 636
Jane Avatar asked Oct 02 '12 16:10

Jane


1 Answers

It works if I use $BUILD_NUMBER instead of %BUILD_NUMBER%

like image 125
Jane Avatar answered Nov 15 '22 07:11

Jane