1

I am deploying to AWS EB from Codeship. Codeship does an npm install to run the tests. It them bundles everything and sends it to AWS, where another npm install happens.

How do I prevent Codeship from bundling my node_modules folder?

sdgfsdh
  • 33,689
  • 26
  • 132
  • 245

1 Answers1

1

The integrated Elastic Beanstalk deployment is based on copying the files over to AWS, so if you want to "ignore" a folder, add a script based deployment before the Elastic Beanstalk deployment and remove the folders you don't want to copy over.

See https://github.com/codeship/scripts/blob/master/deployments/elastic_beanstalk.sh for a script that is very similar (though not quite identical) to the commands run for the integrated deployment.

And see https://documentation.codeship.com/basic/builds-and-configuration/deployment-pipelines/#multi-step-deployment-pipelines for a bit more information on deployment pipelines containing multiple individual steps.

mlocher
  • 766
  • 5
  • 11
  • Where should `elastic_beanstalk.sh` live? In the root of my project? – sdgfsdh Nov 30 '17 at 11:32
  • 1
    You don't need to add that file at all. The link to that script was meant as a reference to how the integrated Elastic Beanstalk deployment works and which commands we (roughly) run on your behalf. – mlocher Nov 30 '17 at 11:33
  • Ah, I understand. How do I add a step before the `elastic_beanstalk.sh` script runs then? – sdgfsdh Nov 30 '17 at 11:36
  • 1
    On the config page for that deployment pipeline, click any other deployment from the options at the bottom and it will get added to the end. You can then reorder them by dragging the number on the left. See the second link I added to the answer for some screenshots. – mlocher Nov 30 '17 at 11:38