-
Notifications
You must be signed in to change notification settings - Fork 185
Post install script #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @navihtot! Thanks for your contribution! Could you explain the usecase and add a bit of documentation on how others might use this function? |
|
Hi, my usecase is that I needed to use CamanJS library on Lambda (which is dependent on node-canvas and fibers). The problem is that canvas needs native libraries compiled on same version of Amazon Linux that lambda runs on, and modules needed to be compiled with node-gyp after that. But I presume someone could have a need to do any other action with .sh script after npm install and before deployment. I'll try to add some simple documentation later today. Btw - lambda now finally supports newer node version 4.3.2., and I tried to deploy with |
|
There is also a npm -> https://www.npmjs.com/package/node-lambda-postinstall |
|
Here, added section Post install script with short description in readme.md |
README.md
Outdated
|
|
||
| ## Post install script | ||
|
|
||
| When running `node-lambda deploy` if you need to do some action after `npm install --production` and before deploying to AWS Lambda (i.e. replace some modules with precompiled ones or download some libraries) you can create `post_install.sh` script. If the file exists the script will be runned (and output shown after execution) if not it is skipped. Make sure that the script is executable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the script will be runned => the script will be executed
|
Could you rebase this branch against current master so it's good to merge? I'm onboard with the changes 👍 |
|
not sure how to do this. i get many conflicts... i could create another fork/branch from current master and implement it there. but wont have time for that until the end of the week. |
|
@navihtot after you've merged in https://github.com/navihtot/node-lambda/pull/1 into your branch, you can rebase by doing the following on your machine: from there you'll see a |
Navihtot post install script
|
tried it. i still get too much conflicts when i do rebase :( should I just create fork again an add functionality from scratch ? after all it just a one function added... |
|
@navihtot that's probably the fastest way if you don't want to deal with the merge conflicts now. If you set that up and create the PR I'll get it merged ASAP so you don't have to deal with any conflicts later on. |
|
here I created another pull request #78 |
If file
post_install.shexists than it is run afternpm install --productionand before creating .zip and deploying to AWS LambdaFixes #67