]> khamidou — GitHub mirrors - kite.git/commitdiff
created script to bootstrap a kite install on a serv
authorkarim hamidou <khamidou@gmail.com>
Tue, 24 Dec 2013 13:10:50 +0000 (14:10 +0100)
committerkarim hamidou <khamidou@gmail.com>
Tue, 24 Dec 2013 13:10:50 +0000 (14:10 +0100)
bootstrap.rb [new file with mode: 0644]

diff --git a/bootstrap.rb b/bootstrap.rb
new file mode 100644 (file)
index 0000000..a451989
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env ruby
+# Setup kite on a non-vagrant machine, like a digital ocean server
+#
+# This script goes through the following steps
+# - setup ssh key-based auth on server
+# - setup git and puppet
+# - clone the kite sources from github
+# - run puppet on the server
+ 
+if ARGV.length != 1 then
+    puts "usage: $0 hostname"
+    exit
+end
+
+hostname=ARGV[0]
+
+if !ENV["SSH_AGENT_PID"] then 
+    `ssh-add`
+end
+
+printf "Setting up public key auth on #{hostname} "
+`ssh-copy-id root@#{hostname}`
+puts "OK"
+
+srcrepo = "https://github.com/khamidou/kite.git"
+printf "Getting the sources from #{srcrepo} "
+
+`ssh root@#{hostname} bash -c "\
+apt-get update;\
+apt-get install -y git puppet;\
+git clone #{srcrepo} /root/kite;"`
+
+puts "OK"