deployer icon indicating copy to clipboard operation
deployer copied to clipboard

Can I execute some jobs before and after deploying to servers?

Open safigo opened this issue 12 years ago • 9 comments

Hello,

Can I execute some tasks before and after (create build for deploying, remove build)?

Thanks

safigo avatar Nov 22 '14 20:11 safigo

before('deploy:start', function () {
    /* your code before deploy starts */ 
});

after('deploy:end', function () { 
    /* your code after deploy ends*/ 
});

gordalina avatar Nov 22 '14 20:11 gordalina

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

safigo avatar Nov 22 '14 20:11 safigo

you can use the runLocally() function

gordalina avatar Nov 22 '14 20:11 gordalina

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.

safigo avatar Nov 22 '14 20:11 safigo

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.

gordalina avatar Nov 23 '14 02:11 gordalina

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

safigo avatar Nov 23 '14 09:11 safigo

@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.

antonmedv avatar Nov 23 '14 09:11 antonmedv

Done in v3.

antonmedv avatar Jan 15 '15 13:01 antonmedv

Thanks

safigo avatar Jan 20 '15 06:01 safigo