Closed run27017 closed 2 years ago
Hi, this is not possible as Mina commands aren't executed one after the other, rather they're all queued first and then executed once as a single command.
However, the feature you're trying to implement (copying node_modules
between releases) can be achieved with shared_dirs
variable. It sets directories which will be symlinked between releases.
You can add node_modules
to shared dirs like this (or you can reuse an existing set :shared_dirs
and just append node modules):
set :shared_dirs, fetch(:shared_dirs, []).push('node_modules')
Once you change that, run mina setup
again and node_modules
will then be shared between releases.
Does this solve your issue?
May I add that in your example, each command is executed on the server, so you don't have to store the max_release var, you could have just replaced #{max_release}
by `ls #{fetch(:releases_path)} -A1 | sort -rn | head -1`
How to get command output so that writing elegant ruby?