3
votes

I have a Build & Deploy Pipeline in Bluemix, I would like to tag git if the stage has been successfully deployed. Currently, I had added a build step after a deploy step into my deploy stage with a shell script that look like:

# put the git tag
echo 'Put tag build_$BUILD_NUMBER on git'
git tag build_$BUILD_NUMBER
git push --tags

The returned error is:

fatal: could not read Username for 'https://hub.jazz.net': No such device or address Build step 'Execute shell' marked build as failure

But it seems that I have no .gitcredentials file to push without need to add authentication information.

How can I push a tag on git into my delivery pipeline??

1

1 Answers

2
votes

You need to enter in the username and password for the remote url. I have tested the following in the past and it worked for me:

 git remote set-url origin https://$USERNAME:[email protected]/git/user/project

where USERNAME and PASSWORD are environment properties on the stage. I recommend setting the password as a secure property so the value is not displayed in the logs. You should be able to push your tags after that.