2

I'm trying to deploy a website via CodeShip unto Heroku. The site is built with Yeoman's Angular-Fullstack generator, which is pushed to GitHub. Codeship detects the push, builds the entire thing and then the trouble start.

Angular-Fullstack is set up so that the dist/ folder contains the entire Heroku app, so blindly deploying everything will not work on Heroku. Locally, I can use the Heroku toolbelt to login, add a remote inside the dist folder, and then use grunt buildcontrol to deploy the entire thing unto Heroku.

But in Codeship there are a few caveats: * I cannot install the Heroku toolbelt with wget because it needs sudo and Codeship doesn't support that * If I could, I couldn't login to Heroku using the CLI because I cannot interact with the shell in Codeship * I cannot go into the dist/ folder and after adding the remote, simply push to Heroku because I need to enter my credentials.

Is there a way that I missed here? I'd like to let Codeship handle everything from building to deployment to Heroku (only on the master branch).

Lodybo
  • 467
  • 5
  • 13

1 Answers1

1

Figured it out!

I skipped the step where I was trying to install the Heroku Toolbelt, and just added the repo on Heroku as remote:

git remote add heroku ssh://git@heroku.com/[your-heroku-app-name].git

Codeship has public keys available for every build. So, I added that publick key to my Heroku account.

Then I noticed that Git was still trying to push using HTTPS instead of SSH, so I added this to the deployment script:

git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/

This made sure that Git uses the SSH url for Heroku. I then let Codeship build the entire project and push it with grunt buildcontrol:heroku.

Lodybo
  • 467
  • 5
  • 13