Whats the best way to deploy app to a server with limited internet access?

54 views
Skip to first unread message

陈若涵

unread,
Dec 28, 2013, 9:39:45 AM12/28/13
to capis...@googlegroups.com
Versions:
  • Ruby - 2.0.0
  • Capistrano - at branch master (almost v3.1.0)
  • Rake / Rails / etc - rails 4.0.1
Platform:
  • Working on.... linux
  • Deploying to... linux
Files:
Here is my situation: I have a bunch of servers(approximately 60) to deploy a rails app. And those servers may not have external internet access. So I have to install gem dependencies locally. Luckily, `bundle package` helped me a lot. But I still don't want to put those gem package file(in `vendor/cache`) into my commit log(too messy).

## The First Thought: upload cache from local to remote

Here is my try, see the gist 8159771. I have a gateway server (have fully internet access) to deploy app to remote servers. First, I make a check for local vendor/cache (cache packages on the gateway server). And then use SSHKit#upload! to upload cache dir recursively to remote server.

That works great when deploy to single server. But the upload progress become a nightmare when you want to deploy to more and more servers, especially those servers are in different Data-Centers.

## The Second Thought: make a git submodule in vendor/cache

I'm not sure git submodule is supported in Capistrano v3. Further more, my app server may not have access to the git source code server (my gateway server also reverse proxy to git server, and set production :repo_url to gateway server).

The biggest problem here is that I cannot specify different submodule git url in production mode,  `git submodule update` may fail due to some kinds of internet error.

## The Last Thought: local tar -> scp -> untar

This may be the best way I can imagine, but has not implemented yet.


Looking for some suggestion, thank you

Lee Hambley

unread,
Dec 31, 2013, 4:39:14 AM12/31/13
to capistrano
Sorry, there's really no good way to do that, you might better just use SSHKit.

In an ideal word, you'd have an "integration" repository, where you push all the "ready to deploy" assets, so your deploy would in effect be two step, one step to move everything to the intermediate server, and commit and push assets to the "release" repository. The 2nd would be a Capistrano deploy from that server, from the repo to your other machines.

It's a bit of work to get that right, but it should be possible.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/9d07eb95-5740-42bf-9e3a-f6ea3ca6b4cb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages