I have a Jenkins job called Git_Tag_Test with following job configuration:
1)build with parameters: SHA and tag name are string parameters
2)git scm
3)batch command to tag the branch.
This Git_Tag_Test job is called from a jenkins pipeline after the prod deployment steps. Git_Tag_Test job runs successfully when I enter the SHA and tag name parameters manually without passing it as variables. Problem is when I call the job from pipeline with SHA name and tag name as variables, the SHA is not recognized.
Here is what the batch command looks like:
echo %Tag_Name%
echo %SHA%
git tag -f -a %Tag_Name% %SHA% -m "Test tag"
git push --tags origin
Here's the output from git tag.
C:\Program Files (x86)\Jenkins\workspace\Git_Tag_Test>echo 2.10.6928.18660
2.10.6928.18660
C:\Program Files (x86)\Jenkins\workspace\Git_Tag_Test>echo 9e47b72e6
9e47b72e6
C:\Program Files (x86)\Jenkins\workspace\Git_Tag_Test>git tag -f -a
2.10.6928.18660
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
7[?47h[27m[24m[0m[H[J[24;1H<ogram Files
(x86)/Jenkins/workspace/Git_Tag_Test/.git/TAG_EDITMSG"
<86)/Jenkins/workspace/Git_Tag_Test/.git/TAG_EDITMSG" [unix] 5L,
93C[2;1H[1m[36m#
# [0m[1m[34mWrite a message for tag:[0m
[1m[36m# 2.10.6928.18660
# Lines starting with '#' will be ignored.[0m
[1m[34m~
[7;1H~
[8;1H~
[9;1H~
[10;1H~
[11;1H~
Echo shows the tag name and SHA is recognized by passing variables but when running the git tag command the SHA variable is not outputting.
Note: "Trim the string" is checked on for the string parameters configuration.
What exactly is the problem? I've searched everywhere on this issue and have been trying to debug this for months.