Commit Tag to bitbucket
I have my builds setup to increment the MINOR revision when a commit is pushed to master and built. It uses the REST API to update the YAML file and everything is great.
Now I want to also tag this specific commit with the version number and push this back to bitbucket.
I saw some examples of folks doing this with Github, but not with Bitbucket (doesnt have personal access tokens :( ).
Any thoughts?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac

Support Staff 1 Posted by Feodor Fitsner on 13 Mar, 2015 06:29 PM
is it Git or Mercurial repo?
2 Posted by william.j.davis... on 14 Mar, 2015 03:03 PM
Hey Feodor - its a Git repo, sorry for not being specific.
Support Staff 3 Posted by Feodor Fitsner on 15 Mar, 2015 03:57 AM
Then this guide is still applicable to you: http://www.appveyor.com/docs/how-to/git-push
Just use username/password instead of personal access token.
4 Posted by william.j.davis... on 16 Mar, 2015 02:15 AM
Thanks Feodor -
I followed the tutorial - here is my resulting build success script: (the relevant portion)
And the error:
Am I missing a step?
I'm going to try and update the remote url and see if that fixes it.
5 Posted by william.j.davis... on 16 Mar, 2015 02:33 AM
That was the key - once I update the remote to not use SSH it worked.
It may be worthwhile to mention that in the howto article
Thanks!
Support Staff 6 Posted by Feodor Fitsner on 16 Mar, 2015 05:57 AM
Yeah, thanks for the note - will update documentation.
7 Posted by william.j.davis... on 16 Mar, 2015 03:59 PM
So it appears this is working correctly, but for some reason it is throwing an exception.
Here is a snip showing the commit pushed correctly:
And here is a snip showing the exception which causes the build to report as failed:
And here is a snip showing the script
I'm not sure why the build says it failed. Thank you!
Support Staff 8 Posted by Feodor Fitsner on 16 Mar, 2015 04:06 PM
It's git outputting to StdErr what treated by PowerShell as exception. Add
--quietto git push command.9 Posted by william.j.davis... on 16 Mar, 2015 04:44 PM
Seriously great support here. You guys rock.
10 Posted by Brian Butterfie... on 31 Mar, 2015 06:38 PM
I am struggling with trying to configure a Bitbucket/Mercurial "push". I cannot seem to find any resources specific, but this post helpful and git specific.
Thank you in advance for your help.
Support Staff 11 Posted by Feodor Fitsner on 31 Mar, 2015 07:29 PM
Basically, your goal is creating
c:\users\appveyor\mercurial.inifile with mercurial repo URL and credentials: http://stackoverflow.com/questions/2584407/how-to-save-username-and...12 Posted by Brian Butterfie... on 31 Mar, 2015 07:55 PM
1) Can I store the username and password in secure fields in environment variables and write them to mercurial.ini in the install script?
2) If they are "secure" variables, will AppVeyor decrypt them when I use them in the install script? Nothing has stated this explicitly in my research so far.
Thank you for your response.
Support Staff 13 Posted by Feodor Fitsner on 31 Mar, 2015 08:27 PM
1) Yes, you can.
2) Yes, however secure variables are not decrypted during Pull Request builds. Other than that secure variables are just regular environment variables available in the build context. The primary purpose of secure variables is hiding sensitive information in appveyor.yml.
14 Posted by Brian Butterfie... on 03 Apr, 2015 03:41 PM
Sorry, but this did not work.
I need a way to add my private SSH key I assume. Is there an additional file in mercurial somewhere I need to add in the case of appveyor?
Support Staff 15 Posted by Feodor Fitsner on 03 Apr, 2015 03:51 PM
mercurial.inididn't work? Have you specified "destination" repository URL inhg pushcommand? Because, if it was initially cloned with SSH default URL is not HTTPS.16 Posted by Brian Butterfie... on 03 Apr, 2015 04:04 PM
Yes, Mercurial.ini did not work. Here is what I had.
$fileContent = "[auth]"
$fileContent += "bb.prefix = https://bitbucket.org/org/repo"
$fileContent += "bb.username = xxxx"
$fileContent += "bb.password = xxxx"
Set-Content c:\users\appveyor\mercurial.ini $fileContent
Are you saying it should be the following? Should the "prefix" be https or ssh? I will try the following.
$fileContent = "[auth]"
$fileContent += "bb.prefix = https://bitbucket.org/org/repo"
$fileContent += "bb.username = xxxx"
$fileContent += "bb.password = xxxx"
$fileContent += "[paths]"
$fileContent += "default = ssh://[email blocked]/org/repo"
Set-Content c:\users\appveyor\mercurial.ini $fileContent
Support Staff 17 Posted by Feodor Fitsner on 03 Apr, 2015 04:11 PM
Shouldn't be there a "new line" symbol at the end of each line? kind of:
Regarding repo URL I meant specifying https repo URL when pushing back:
18 Posted by Brian Butterfie... on 03 Apr, 2015 04:18 PM
I can try that, but I do have it working by passing the username and password via the
hg push <repo_url>in the following script.$url = "https://username:" + $env:BITBUCKET_PASSWORD + "@bitbucket.org/org/repo"hg push $urlHowever, I would prefer not to store my password at all in the secure env variables.
Support Staff 19 Posted by Feodor Fitsner on 03 Apr, 2015 04:22 PM
Then how/where would you pass/store the password then?
-Feodor
20 Posted by Brian Butterfie... on 03 Apr, 2015 05:10 PM
I should not need the password if I can associate the private SSH key somewhere in the Mercurial configuration. That is my current root question/issue.
Support Staff 21 Posted by Feodor Fitsner on 03 Apr, 2015 06:24 PM
Then it's the same location/technique as described here: http://www.appveyor.com/docs/how-to/private-git-sub-modules
22 Posted by merdan on 31 Dec, 2016 01:32 AM
How to update the remote to not use SSH.
I am using BitBucket wit Git repo
Support Staff 23 Posted by Feodor Fitsner on 31 Dec, 2016 05:39 AM
This might help: http://stackoverflow.com/questions/6223039/push-to-multiple-remote-...
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:10 AM.