views:

210

answers:

4

i have create clone of project on local machine with

git clone [email protected]:test/abc.git

Now i want to deploy my project on my ubuntu server .

so i have created a script which install git on my ubuntu server. And now i want to deploy my rails project on server. like git clone [email protected]:test/abc.git but i have not set ssh key on my server. Is there any way i can create clone without set up ssh key on my server.

Is compulsotion that we have to create to ssh each on every server?

What if i have 20 server ? i need to set up ssh key for every server to clone?

Is there any way just ask the password than it will create a clone?

Or any other way?

+2  A: 

You can use the read-only version. Next to the name of your repository you can select the http protocol. This url can be used without ssh key. If it is a private repository you'll need to add your username to the url.

$ git clone http://[email protected]:test/abc.git
Initialized empty Git repository in /Users/myname/Projects/abc/.git/
password: 

Then you type your password and a bit later you have your clone. A disadvantage is that you need to enter your password if you use a private repo.

Although I fail to see the problem of adding a few ssh-keys. If you really need to deploy to 20 servers you might consider thinking of using a packaging method with good OS support for automatic updating.

Peter Tillemans
can you give me example?
krunal shah
I updated the answer with an example.
Peter Tillemans
+1  A: 

It is a mistake to try to use a configuration management tool in order to deploy an installation. Do you really intend to update the code from each of those 20 systems? Why then are you granting them write access to the code?

Create a tarball or use whatever package management systems are available in the language you are developing in (e.g. in Perl, you could use Dist::Zilla, Module::Install or ExtUtils::MakeMaker).

Ether
A: 

We created a php script which built RPMs (and Using Alien also built DEBs) for updating our 200+ machine fleet. As a url like "http://repo/fetch/rpm/" was called a script checked if there had been a new git tag inserted in package_name repository and if so use an RPM template we created on a per repo basis (typically put in .build/rpm.spec) to build the RPM, save it to a local cache directory and read the contents out as a file header.

I realize for your application that won't work since you're using GitHub - but it's just an idea for those who have their own remote repositories. A cron on the boxes would query once a day those URLs and run rpm -Uvh on the output.

For your instance it might be wise to tarball each release and either put that in a public accessible URL or create a script to rsync it to each server + exec

Marco Ceppi
A: 

If you're deploying rails projects, you should check out Capistrano - http://www.capify.org/index.php/Getting_Started

Jamie Wong