Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local shell commands #69

Closed
leizzer opened this issue Nov 22, 2012 · 2 comments
Closed

Local shell commands #69

leizzer opened this issue Nov 22, 2012 · 2 comments

Comments

@leizzer
Copy link

leizzer commented Nov 22, 2012

Is there a way to mix local shell commands and remote commands?

I take a quick look and it seems that the gem queue all the remote commands until the end, then mina execute the remote commands.

I have an small vps and I can't compile the assets there, I need to precomplile the assets in my local machine first. And it would be nice if I could mix local and remote commands in one task.

I can't even create a task like this:
task :deploy => :prepare_assets do ... end

All the commands will mixed up if I do something like that.

The only solution for me was to create 3 tasks: prepare_assets, deploy and deploy_assests

What do you recommend?

@rstacruz
Copy link
Member

If that's what you're after, you should take a look at Capistrano or Vlad. The "queue everything and execute" is precisely why Mina was created, as other deploy tools don't do the same thing.

You can also simply compile all the assets first, tarball the entire assets/ directory, scp it, and catch it after deploying.

# Haven't tested, all hypothetical!
task :prepare_assets do
  set :asset_file, "assets.%s.tar.gz" % [Time.now.strftime("%Y%m%d%h%n%s")] # ?
  system "bundle exec rake assets:precompile RAILS_GROUPS=assets"
  system "tar -zxc assets -f /tmp/#{asset_file}"
  system "scp /tmp/#{asset_file} #{user}@#{domain}:/tmp/#{deploy_to}/tmp/#{asset_file}"
end

This may seem hackish as there's no Mina helper API to handle this case, but this isn't a popular use case so far, and Capistrano may be better suited for your purposes.

@leizzer
Copy link
Author

leizzer commented Dec 19, 2012

Yes, I'm doing something like that right now.

Thanks for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants