注意事项
- You might want to commit your node_modules folder (#622) or add the
npm install
command to the post-deploy
section: "post-deploy" : "npm install && pm2 startOrRestart ecosystem.json --env production"
- Verify that your remote server has the permission to git clone the repository
- You can declare specific environment variable depending on the environment you want to deploy the code to. For instance to declare variables for the production environment, just add "env_production": {} and declare that variables.
- PM2 will look by default to
ecosystem.json
. So you can skip the options if it's the case
- You can embed the "apps" & "deploy" section in the package.json
- It deploys your code via ssh, you don't need any dependencies
- Process are initialized / started automatically depending on application name in
ecosystem.json
- PM2-deploy repository is there: pm2-deploy