I need to push a node application that will be executing a bash script and the script file needs to have the execute bit set. Can the cf command line utility allow me to set execute permission?
If it doesn't, can I do something during the staging cycle of my app to set execute permission bits?
A script that has the execute bit set will also have it set when being pushed.
If you need to have a script invoked as part of staging or pushing the app, there are two options:
Invoke script during staging
Use
scripts.preinstall
stanza inpackage.json
to run scripts during staging (duringnpm install
, see here for more options), and include that script with your application:Invoke script after staging
If the script can be run before app is started, but after staging, use
.profile.d
. Before your app is started in the container (after staging), a bash shell will run all scripts in your.profile.d
folder.For example, I could have a
my_app/.profile.d/aScript.sh
file with:export key=value
orchmod +x some_file