How to keep executable bits for files during 'cf push' for Node applications?

I need to push a node application that will execute the bash script file and the execute bit must be set for the script file. Can the cf command line utility allow me to set execute permission?

If it is not, is there anything I can do during the install cycle of my application to set the execute permission bits?

+3


source to share


1 answer


A script that has an execute bit will also be set when pressed.

If you need a script that gets called as part of a step or application push, there are two options:

Calling script during a stage

Use scripts.preinstall

stanza in package.json

to run scripts during a stage (during npm install

, see here for more options) and include the script in your application:

"scripts": {
  "start": "node app.js",
  "preinstall": "./configure"
},

      



Calling script after stage

If the script can be run before the application starts, but after the stage , use .profile.d

. Before running the application in the container (after the stage), the bash shell runs all scripts in your folder .profile.d

.

For example, I could have a file my_app/.profile.d/aScript.sh

with:

export key=value

or chmod +x some_file

+2


source







All Articles