Search code examples
deploymentcontinuous-integrationappharborappveyor

AppVeyor deploy to AppHarbor


I would like to build my application in AppVeyor and then deploy it to AppHarbor.

I'm guessing there's a way to get AppVeyor to push the built code to the AppHarbor Repository URL but I can't figure out how to do it.

Would anyone be able to point me in the right direction?


Solution

  • I managed to get this working by doing the following:

    I went to AppVeyor -> Encrypt Data and encrypted my AppHarbor username and password.

    Added an appveyor.yml file to my GitHub repo:

    environment:
    username:
        secure: <Encrypted Username>
    password:
        secure: <Encrypted Password>
    
    on_success:
      - git config --global credential.helper store
      - ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:username):$env:password@appharbor.com`n"
      - git remote add appharbor <AppHarbor Repository Url>
      - git push appharbor master
    

    Once I confirmed this was working I went to Service Hooks in AppHarbor and deleted the GitHub one. And also removed hook on GitHub side.

    In my case I am doing this because I want to run my tests in AppVeyor but not in AppHarbor. I managed this by disabling my test project from building in Release mode. But this could also be achieved with an AppHarbor.sln file.