0

I need to run npm run build --release and only deploy the files in my build folder. How do I configure codeship heroku deployment to do so. Should I add custom steps to the test settings?

I could create a custom script deployment step but I would like to use the heorku configuration that's built in to codeship if I can.

MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460

1 Answers1

-2

The integrated Heroku deployment on Codeship is based on running a git push, so you would need to run the npm run build --release command, and then commit those changes to the repository.

That would also require you to enable force pushing to the remote repository on Heroku as the next build (triggered by GitHub/Bitbucket/Gitlab) would not include that auto-generated commit.

That said, we built a script to deploy to Heroku based on their build API, which is available at https://github.com/codeship-library/heroku-deployment/blob/master/scripts/codeship_heroku_deploy

It is intended to be used by our Docker based platform (called Codeship Pro), but the same commands would work as a custom script deployment on Codeship Basic as well.

mlocher
  • 766
  • 5
  • 11
  • 3
    Committing files which are the output of the build process into source control is definitely not the right pattern. – jwg May 17 '17 at 22:36
  • Yeah, I agree it's not the right pattern. This is a workaround for the specific use case asked about in the question. There are other ways to deploy to Heroku as well, and I included a link to a deployment script that uses an approach based on copying files instead of doing a `git push` instead as well. – mlocher Jun 16 '17 at 10:39