lobot 0.9.0 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use ruby-1.9.2-p180@lobot
1
+ rvm use ruby-1.8.7-p299@lobot
data/docs/ci_yml.md ADDED
@@ -0,0 +1,47 @@
1
+ # app_name
2
+ A short name for your application. This will be used as the name of the build in jenkins.
3
+
4
+ # app_user
5
+ The user created to run jenkins. This can be set to the same value as app_name if desired.
6
+
7
+ # git_location
8
+ The location of your remote git repository which Jenkins will poll and pull from on changes. If it's a public project, use the http://github.com/user/project.git url. If it's a private project, use the ssh form, git@github.com:user/project.git.
9
+
10
+ # basic_auth:
11
+ - username: # The username you will use to access the Jenkins web interface
12
+ password: # The password you will use to access the Jenkins web interface
13
+ The basic auth field is an array of hashes containing the usernames and passwords you would like to be able to access jenkins.
14
+
15
+ # credentials:
16
+ Currently Lobot only supports managing EC2 servers. To start a new instance, the rake task needs to be able to connect to ec2 and ask it to launch a server.
17
+ ## aws_access_key_id:
18
+ The Access Key for your Amazon AWS account. You can obtain it by visiting
19
+ https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key
20
+ ## aws_secret_access_key: The Secret Access Key for your Amazon AWS account
21
+ This will be available at the same URL.
22
+ ## provider: AWS
23
+ This tells Lobot to use Amazon web services. Currently AWS is the only valid value.
24
+
25
+ # server:
26
+ The server section is where Lobot keeps track of the instance that it launches when you run rake ci:server_start
27
+ ## name:
28
+ The name is the server's machine name - either ip address or DNS name. Usually you'll just run ci:server_start to populate it.
29
+ # instance_id:
30
+ The instance_id is also saved, in order to facilitate stopping and starting instances. Stopping" is AWS's term for shutting down an instance temporarily - when it is started, it will use the same EBS volume and continue where it left off. However, it will receive a new ip address and DNS name.
31
+
32
+ # build_command: ./cruise_build.sh
33
+ The build command is the shell script that Jenkins will execute to run your build. While you could put this script is the Jenkins configuration, it's clearer to have it in a script directly checked into your project.
34
+
35
+ # ec2_server_access:
36
+ key_pair_name: myapp_ci
37
+ id_rsa_path: ~/.ssh/id_rsa
38
+
39
+ The EC2 server access section is perhaps the most confusing field in the ci.yml file. This section tells Lobot what ssh keys to use to access the servers it spins up. When you run rake ci:sever_start, Lobot first looks in your ec2 account to see if they key pair name you specified exists - if it doesn't, it uploads the specified #{id_rsa_path}.pub to amazon, and names it #{key_pair_name}. It then launches the server, telling EC2 to use the key pair specified.
40
+
41
+ # id_rsa_for_github_access
42
+ id_rsa_for_github_access: |-
43
+ -----BEGIN RSA PRIVATE KEY-----
44
+ SSH KEY WITH ACCESS TO GITHUB GOES HERE
45
+ -----END RSA PRIVATE KEY-----
46
+
47
+ This is the rsa key that jenkins will use when connecting to github. Note that it is indented as it's a multiline markdown string.
data/features/ci.feature CHANGED
@@ -8,9 +8,11 @@ Feature: CI
8
8
  When I create a new Rails project using a Rails template
9
9
  And I vendor Lobot
10
10
  And I put Lobot in the Gemfile
11
+ And I add a gem with an https://github.com source
11
12
  And I run bundle install
12
13
  And I run the Lobot generator
13
14
  And I enter my info into the ci.yml file
15
+ And I change my ruby version
14
16
  And I push to git
15
17
  And I run the server setup
16
18
  And I bootstrap
@@ -1,6 +1,7 @@
1
1
  ---
2
- aws_access_key_id:
2
+ aws_access_key_id:
3
3
  aws_secret_access_key:
4
- id_rsa: |-
4
+ id_rsa_for_github_access: |-
5
5
  -----BEGIN RSA PRIVATE KEY-----
6
6
  -----END RSA PRIVATE KEY-----
7
+
@@ -28,8 +28,13 @@ When /^I put Lobot in the Gemfile$/ do
28
28
  system!(%{echo "gem 'lobot'" >> testapp/Gemfile})
29
29
  end
30
30
 
31
+ When /^I add a gem with an https:\/\/github.com source$/ do
32
+ system!(%{echo "gem 'greyhawkweather', :git => 'https://github.com/verdammelt/Greyhawk-Weather.git'" >> testapp/Gemfile})
33
+ end
34
+
31
35
  When /^I run bundle install$/ do
32
36
  system("cd testapp && gem uninstall lobot")
37
+ system("cd testapp && gem install bundler")
33
38
  system!("cd testapp && bundle install")
34
39
  system!('cd testapp && bundle exec gem list | grep lobot')
35
40
  end
@@ -59,7 +64,15 @@ When /^I enter my info into the ci\.yml file$/ do
59
64
  end
60
65
  end
61
66
 
67
+ When /^I change my ruby version$/ do
68
+ system! "cd testapp && echo 'rvm use ruby-1.8.7-p299@lobot' > .rvmrc"
69
+ end
70
+
71
+
62
72
  When /^I push to git$/ do
73
+ lobot_dir = File.expand_path('../../', File.dirname(__FILE__))
74
+ system! "rm testapp/vendor/cache/*"
75
+ system! "cp #{lobot_dir}/pkg/lobot-#{Lobot::VERSION}.gem testapp/vendor/cache/"
63
76
  system! "echo 'config/ci.yml' >> testapp/.gitignore"
64
77
  system! "cd testapp && git add ."
65
78
  system! "cd testapp && git commit -m'initial commit'"
@@ -73,15 +86,6 @@ When /^I run the server setup$/ do
73
86
  end
74
87
 
75
88
  When /^I bootstrap$/ do
76
- server_is_available = false
77
- iterations = 0
78
- until server_is_available
79
- server_is_available = system("cd testapp && cap ci check_for_server_availability")
80
- puts "Sleeping for 3 seconds"
81
- sleep 3
82
- iterations += 1
83
- raise "server is not available" if iterations > 10
84
- end
85
89
  system! "cd testapp && cap ci bootstrap"
86
90
  end
87
91
 
@@ -39,7 +39,7 @@ set -e
39
39
  export APP_USER=$1
40
40
 
41
41
  mkdir -p /home/$APP_USER/rvm/src
42
- curl -Lskf http://github.com/wayneeseguin/rvm/tarball/156d0b42feba4922ad04 | tar xvz -C/home/$APP_USER/rvm/src --strip 1
42
+ curl -Lskf http://github.com/wayneeseguin/rvm/tarball/7680ad29b90cfcc59f3588a6d1fc7c2806df9f19 | tar xvz -C/home/$APP_USER/rvm/src --strip 1
43
43
  cd "/home/$APP_USER/rvm/src" && ./install
44
44
 
45
45
  rvm_include_string='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"'
@@ -3,5 +3,7 @@ include_recipe "pivotal_server::postgres"
3
3
  include_recipe "pivotal_server::sqlite"
4
4
  include_recipe "pivotal_server::libxml_prereqs"
5
5
  include_recipe "pivotal_server::nginx"
6
+ include_recipe "pivotal_server::ca_cert"
7
+ include_recipe "pivotal_server::node_js"
6
8
  include_recipe "pivotal_ci::id_rsa"
7
9
  include_recipe "pivotal_ci::jenkins"