Sometimes I only want to update the configuration file on my server, which I set using the pre-deploy-local hook, and I know that the server is on the latest commit. And I have to do a full deploy which also fetches the whole repo and runs the post-deploy script(build step) which builds the whole project again.
It would be nice if we could run only a single hook, like
pm2 deploy deploy-name pre-deploy
This is also useful if the build fails for some unknown reason and you just want do it again without having to fetch and run the pre-deploy-hook.
It would be even better if I could define custom scripts with their own sub commands. Like:
deploy: {
deploy-name: {
user: 'node',
host: ['x.x.x.x'],
ref: 'origin/master',
repo: 'git@github.com:user/repo.git,
path: deployPath,
'pre-deploy-local': "echo 'All done';",
'post-deploy': 'npm install; npm run build;',
updateConfig-local: `scp ${localConfig} ${remoteLocation}`, // -local suffix to specifiy that it should be run on local machine
build: 'npm run build', // this will be run on remote machine
}
}
Sometimes I only want to update the configuration file on my server, which I set using the pre-deploy-local hook, and I know that the server is on the latest commit. And I have to do a full deploy which also fetches the whole repo and runs the post-deploy script(build step) which builds the whole project again.
It would be nice if we could run only a single hook, like
This is also useful if the build fails for some unknown reason and you just want do it again without having to fetch and run the pre-deploy-hook.
It would be even better if I could define custom scripts with their own sub commands. Like:
And then I can just do
or
and it should just run that command