Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Example Dollhouse configuration for building a hudson-ci server from …

…scratch.
  • Loading branch information...
commit 434dd971776b194c73736f7676a4a0204c15dd98 1 parent c79f0f0
Gareth Townsend authored October 27, 2010
1  .gitignore
... ...
@@ -0,0 +1 @@
  1
+.rvmrc
46  README.markdown
Source Rendered
... ...
@@ -0,0 +1,46 @@
  1
+# Dollhouse Hudson
  2
+
  3
+[Dollhouse](http://github.com/geelen/dollhouse) configuration for turning a vanilla ubuntu install into a functioning hudson-ci server.
  4
+
  5
+All you need to get started is a freshly install Ubuntu Machine (Mine is in VMWare) and another computer with Ruby installed.
  6
+
  7
+## Usage
  8
+
  9
+1. Get [Dollhouse](http://github.com/geelen/dollhouse) set up.
  10
+2. Install openssh on your Ubuntu machine.
  11
+
  12
+  $ sudo apt-get install openssh-server openssh-client
  13
+  
  14
+3. Create a password for the root account on your Ubuntu machine. 
  15
+
  16
+  $ sudo su -
  17
+  $ passwd
  18
+  
  19
+4. Ensure the .ssh directory is present on your Ubuntu machine's root home directory.
  20
+
  21
+  $ sudo su -
  22
+  $ mkdir .ssh
  23
+  
  24
+5. From now on, everything happens on your own computer. Copy your ssh public key over to the server.
  25
+
  26
+  $ scp ~/.ssh/id_rsa.pub root@remote.server.com:.ssh/authorized_keys
  27
+  
  28
+6. Update config/dollhouse/instances/server.yml with the IP address of your vanilla ubuntu machine.
  29
+
  30
+7. Update config/dollhouse/auth.rb with your authentication details.
  31
+
  32
+8. Giddy Up
  33
+  $ /path/to/dollhouse.rb run hudson setup
  34
+  
  35
+9. Visit http://remote.server.com:8080 and bathe in the glory of your fresh Hudson install, with the git, github, ruby and rake plugins pre-installed.
  36
+
  37
+## Where's the Magic?
  38
+
  39
+[Dollhouse](http://github.com/geelen/dollhouse) uses [Babushka](http://github.com/benhoskings/babushka) to build servers. The dollhouse configuration is stored in config/dollhouse/deployments/hudson.rb
  40
+
  41
+Here's what the setup task does:
  42
+
  43
+1. bootstraps the server, installs [Babushka](http://github.com/benhoskings/babushka) so that the rest can function.
  44
+2. Creates a hudson user with the password specified in Auth and copies the public ssh key to the hudson users account.
  45
+3. Installs Hudson and all of its dependencies.
  46
+4. Installs some useful Hudson plugins for rails.
4  config/dollhouse/auth.rb
... ...
@@ -1,5 +1,5 @@
1 1
 module Auth
2 2
   KEYPAIR = Dir.glob(File.expand_path "~/.ssh/id_[dr]sa").first
3  
-  DB_USER_PASSWORD = "sekret"
4  
-  SERVER_PASSWORD = "evenmoarsekret"
  3
+  DB_USER_PASSWORD = "password"
  4
+  SERVER_PASSWORD = "password"
5 5
 end
18  config/dollhouse/deployments/common.rb
... ...
@@ -1,18 +0,0 @@
1  
-# Defining constants for simple reuse of variables or tasks
2  
-
3  
-STATS = lambda {
4  
-  shell "hostname"
5  
-  shell "df -h"
6  
-  shell "ifconfig"
7  
-  shell "monit status"
8  
-}
9  
-
10  
-COMMON_OPTIONS = {
11  
-  :app_name => 'applol',
12  
-  :rails_root => '/data/applol/current',
13  
-  :db_name => 'applol',
14  
-  :db_username => 'marketplace',
15  
-  :db_password => Auth::DB_USER_PASSWORD,
16  
-  :db_encoding => 'utf8',
17  
-  :symlink => '~/current_app'
18  
-}
19  config/dollhouse/deployments/hudson.rb
... ...
@@ -0,0 +1,19 @@
  1
+deployment :hudson do
  2
+  server "hudson" do
  3
+    
  4
+    task 'setup' do
  5
+      bootstrap
  6
+      
  7
+      babushka 'quamen:user set up from root',
  8
+               :username            => 'hudson',
  9
+               :password            => Auth::SERVER_PASSWORD,
  10
+               :your_ssh_public_key => File.read(Auth::KEYPAIR + '.pub')
  11
+      
  12
+      as "hudson", :password => Auth::SERVER_PASSWORD do
  13
+        babushka 'quamen:hudson'
  14
+        babushka 'quamen:hudson plugins for rails'
  15
+      end
  16
+    end
  17
+    
  18
+  end
  19
+end
25  config/dollhouse/deployments/staging-demo.rb
... ...
@@ -1,25 +0,0 @@
1  
-deployment :staging do
2  
-  server "staging_server" do
3  
-    task "stats", &STATS
4  
-
5  
-    task 'setup' do
6  
-      bootstrap
7  
-      babushka 'benhoskings:system'
8  
-      babushka 'geelen:user set up from root',
9  
-               :username            => 'applol',
10  
-               :password            => Auth::SERVER_PASSWORD,
11  
-               :your_ssh_public_key => File.read(Auth::KEYPAIR + '.pub'),
12  
-               :fixed_uid_and_gid   => 1001
13  
-
14  
-      as "applol", :password => Auth::SERVER_PASSWORD do
15  
-        babushka 'benhoskings:user setup',
16  
-                 :your_ssh_public_key => File.read(Auth::KEYPAIR + '.pub'),
17  
-                 :github_user => 'geelen'
18  
-        babushka 'geelen:time zone set', :timezone => 'Australia/Melbourne'
19  
-        babushka 'your_deps:rails_app', COMMON_OPTIONS.merge({
20  
-          :server_name => name_in_cloud
21  
-        })
22  
-      end
23  
-    end
24  
-  end
25  
-end
10  config/dollhouse/instances/servers.yml
... ...
@@ -1,7 +1,7 @@
1 1
 ---
2  
-stagingX: !ruby/struct:Dollhouse::OnlineServer
3  
-  name_in_cloud: stagingX
4  
-  server_name: staging_server
5  
-  ip: IP.GO.HERE
  2
+hudson: !ruby/struct:Dollhouse::OnlineServer
  3
+  name_in_cloud: hudson
  4
+  server_name: hudson
  5
+  ip: 172.16.106.128
6 6
   status: :running
7  
-  deployment_name: staging
  7
+  deployment_name: hudson

0 notes on commit 434dd97

Please sign in to comment.
Something went wrong with that request. Please try again.