Can I execute some jobs before and after deploying to servers?
Hello,
Can I execute some tasks before and after (create build for deploying, remove build)?
Thanks
before('deploy:start', function () {
/* your code before deploy starts */
});
after('deploy:end', function () {
/* your code after deploy ends*/
});
Sorry, I forgot write about server, I want execute before and after tasks on local server.
for example:
- local:start
- server1:deploy:start
- server2:deploy:start
- server3:deploy:start
- ...
- server1:deploy:end
- server2:deploy:end
- server3:deploy:end
- local:end
Thanks
you can use the runLocally() function
hmm, bun it's doubtful decision.
I want run full task with all functions: copy, run, cd, etc. And I want run one time before all deploying and one time after.
I don't know if that's possible, maybe @elfet will shed some light on this. Although having deployments made on a one-by-one server makes some sense, especially when deployment is parallelized.
I want be ensured what all servers have on build (all dependencies, all compiled files etc.), if you execute task "create build" on all servers you can't be ensure what you have the one build on all servers
@DropSQL now this does not possible (but you can implement it your self). But Deployer v3 will have once() method which will do exactly you want.
Done in v3.
Thanks