##For private projects:
-
Remove Appveyor deployment key from https://bitbucket.org/<your_account_name>/<your_repo>/admin/deploy-keys/
-
Copy this key content from https://ci.appveyor.com/project/<your_account_name>/<your_repo>/settings > SSH public key
-
Add new key in https://bitbucket.org/account/user/<your_account_name>/ssh-keys/ and paste content copied before
Points 1 – 3 needed to allow appveyor to push, as by default SSH key used is deployment key which has read-only permissions.
- Add the following to appveyor.yml (you can do on_success if you need):
deploy_script:
# add username to mercurial settings
- echo [ui] > C:\Users\appveyor\mercurial.ini
- echo username = <your_account_name> >> C:\Users\appveyor\mercurial.ini
# create sample change, commit commit and push. Note that [skip ci] in commit message to avoid recurcive builds start
- echo a > myfile2.txt
- hg status
- hg add myfile2.txt
- hg status
- hg commit -m "Added one file [skip ci]"
- hg status
- hg push
This assumes that <your_account_name> is the same on BitBucket and AppVeyor. Please replace accordingly if it different.
##For public projects: Using hint from [here] (http://stackoverflow.com/questions/2584407/how-to-save-username-and-password-with-mercurial)
environment:
bbpwd:
secure: <encrypted_bitBucket_password>
deploy_script:
- echo [ui] > C:\Users\appveyor\mercurial.ini
# note that I was needed to use email I use for BB login, not name I see in BB repo URL
- echo username = <bitBucket_account_name> >> C:\Users\appveyor\mercurial.ini
- echo [auth] >> C:\Users\appveyor\mercurial.ini
- echo bb.prefix = https://bitbucket.org >> C:\Users\appveyor\mercurial.ini
- echo bb.username = <bitBucket_account_name> >> C:\Users\appveyor\mercurial.ini
- echo bb.password = %bbpwd% >> C:\Users\appveyor\mercurial.ini
- echo a > myfile.txt
- hg status
- hg add myfile.txt
- hg status
- hg commit -m "Added one file [skip ci]"
- hg status
- hg push