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

Run deploy outside of app directory #3

Closed
sosedoff opened this issue Jun 7, 2012 · 8 comments
Closed

Run deploy outside of app directory #3

sosedoff opened this issue Jun 7, 2012 · 8 comments

Comments

@sosedoff
Copy link
Contributor

sosedoff commented Jun 7, 2012

Im using mina to deploy multiple apps from single server, which does not have project's source code, but only has scripts to deploy (mina scripts). I created a simple hack that allows you to pass --config parameter.

So the use case is something like this:

mina deploy --config=/path/to/script

Would it be possible to integrate into master?

You can check out my implementation here - https://github.com/sosedoff/mina/tree/external-config
Not sure if its a correct way to integrate with rake.

@rstacruz
Copy link
Member

rstacruz commented Jun 7, 2012

To be in line with Rake's usage, I believe should be rake -f script.rb.

The modification here will be very minimal, this line would just have to be suppressed if -f is given.

@rstacruz
Copy link
Member

rstacruz commented Jun 7, 2012

This one-code-line edit should do the trick:

diff --git a/bin/mina b/bin/mina
index 6379630..05c1ca7 100755
--- a/bin/mina
+++ b/bin/mina
@@ -26,7 +26,10 @@ Rake.application.instance_eval do
   standard_exception_handling do
     # Initialize Rake and make it think it's Mina.
     init 'mina'
-    @rakefiles = ['Minafile', 'config/deploy.rb']
+
+    # Assume different default Rakefiles.
+    # (The only way a @rakefiles can have multiple values is if -f isn't specified.)
+    @rakefiles = ['Minafile', 'config/deploy.rb']  if @rakefiles.size > 1

     # Workaround: Rake 0.9+ doesn't record task descriptions unless it's needed.
     # Need it for 'mina help'

@rstacruz
Copy link
Member

rstacruz commented Jun 7, 2012

This is in v0.1.1 now--just do mina -f file.rb. Does it suit your requirements?

@sosedoff
Copy link
Contributor Author

sosedoff commented Jun 7, 2012

Yep, totally. I cant believe i missed that -f option in rake.

@sosedoff sosedoff closed this as completed Jun 7, 2012
@garethrees
Copy link

To confirm, does this mean I can use mina on a central deployment server which does not have access to the source code and then use it like so:

mina -f apps/app1.rb
# => Deploys app 1

mina -f apps/app2.rb
# => Deploys app 2

@rstacruz
Copy link
Member

rstacruz commented Aug 7, 2012

Indeed you may, @garethrees.

@sosedoff
Copy link
Contributor Author

sosedoff commented Aug 7, 2012

Yeah, the syntax to deploy would be:

mina -f apps/app1.rb deploy
mina -f apps/app2.rb deploy

Im using it the same way

@garethrees
Copy link

Amazing, thanks both

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

3 participants