lobot 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/generators/lobot/install_generator.rb +2 -0
- data/lib/generators/lobot/templates/bootstrap_server.sh +1 -1
- data/lib/generators/lobot/templates/capistrano-ci.rb +2 -2
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/templates/default/jenkins-job-config.xml.erb +14 -18
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/postgres.rb +1 -1
- data/lib/generators/lobot/templates/ci.yml +1 -1
- data/lib/generators/lobot/templates/ci_build.sh +19 -0
- data/lib/lobot/tasks/ci.rake +15 -1
- data/lib/lobot/version.rb +1 -1
- data/spec/install_spec.rb +2 -3
- metadata +5 -4
@@ -8,6 +8,8 @@ module Lobot
|
|
8
8
|
template 'deploy-ci.rb', 'config/deploy/ci.rb'
|
9
9
|
template 'capistrano-ci.rb', 'config/capistrano/ci.rb'
|
10
10
|
template 'soloistrc', 'soloistrc'
|
11
|
+
template 'ci_build.sh', 'script/ci_build.sh'
|
12
|
+
system "chmod a+x #{destination_root}/script/ci_build.sh"
|
11
13
|
end
|
12
14
|
|
13
15
|
def add_load_path_to_capfile
|
@@ -21,7 +21,7 @@ perl -p -i -e 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh
|
|
21
21
|
/etc/init.d/sshd reload
|
22
22
|
|
23
23
|
# install epel
|
24
|
-
rpm -q epel-release-5-4.noarch || rpm -Uvh http://
|
24
|
+
rpm -q epel-release-5-4.noarch || rpm -Uvh http://mirrors.kernel.org/fedora-epel/5/x86_64/epel-release-5-4.noarch.rpm
|
25
25
|
|
26
26
|
# install git
|
27
27
|
yum -y install git
|
@@ -55,7 +55,7 @@ task :upload_cookbooks do
|
|
55
55
|
run "sudo mkdir -p #{app_dir}"
|
56
56
|
run "sudo chown -R #{user} #{app_dir}"
|
57
57
|
run "rm #{app_dir}/soloistrc || true"
|
58
|
-
run "rm -
|
58
|
+
run "rm -rf #{app_dir}/chef"
|
59
59
|
upload("soloistrc", "#{app_dir}/soloistrc")
|
60
60
|
upload("config/ci.yml", "#{app_dir}/ci.yml")
|
61
61
|
upload("chef/", "#{app_dir}/chef/", :via => :scp, :recursive => true)
|
@@ -64,5 +64,5 @@ end
|
|
64
64
|
desc "Run soloist"
|
65
65
|
task :run_soloist do
|
66
66
|
ci_setup
|
67
|
-
run "cd #{app_dir} && PATH=/usr/sbin:$PATH APP_NAME=#{fetch(:app_name)} APP_DIR=#{fetch(:app_dir)} LOG_LEVEL=debug soloist"
|
67
|
+
run "cd #{app_dir} && ROLES=$CAPISTRANO:HOSTROLES$ PATH=/usr/sbin:$PATH APP_NAME=#{fetch(:app_name)} APP_DIR=#{fetch(:app_dir)} LOG_LEVEL=debug soloist"
|
68
68
|
end
|
@@ -5,42 +5,38 @@
|
|
5
5
|
<keepDependencies>false</keepDependencies>
|
6
6
|
<properties/>
|
7
7
|
<scm class="hudson.plugins.git.GitSCM">
|
8
|
-
<configVersion>
|
9
|
-
<
|
10
|
-
<
|
11
|
-
<
|
12
|
-
<
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
<string>git-upload-pack</string>
|
17
|
-
<string>uploadpack</string>
|
18
|
-
<string>git-upload-pack</string>
|
19
|
-
<string>url</string>
|
20
|
-
<string><%= CI_CONFIG['git_location'] %></string>
|
21
|
-
<string>tagopt</string>
|
22
|
-
<string></string>
|
23
|
-
</org.spearce.jgit.transport.RemoteConfig>
|
24
|
-
</remoteRepositories>
|
8
|
+
<configVersion>2</configVersion>
|
9
|
+
<userRemoteConfigs>
|
10
|
+
<hudson.plugins.git.UserRemoteConfig>
|
11
|
+
<name></name>
|
12
|
+
<refspec></refspec>
|
13
|
+
<url><%= CI_CONFIG['git_location'] %></url>
|
14
|
+
</hudson.plugins.git.UserRemoteConfig>
|
15
|
+
</userRemoteConfigs>
|
25
16
|
<branches>
|
26
17
|
<hudson.plugins.git.BranchSpec>
|
27
18
|
<name>master</name>
|
28
19
|
</hudson.plugins.git.BranchSpec>
|
29
20
|
</branches>
|
30
|
-
<
|
21
|
+
<disableSubmodules>false</disableSubmodules>
|
31
22
|
<recursiveSubmodules>false</recursiveSubmodules>
|
32
23
|
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
33
24
|
<authorOrCommitter>false</authorOrCommitter>
|
34
25
|
<clean>false</clean>
|
35
26
|
<wipeOutWorkspace>false</wipeOutWorkspace>
|
36
27
|
<pruneBranches>false</pruneBranches>
|
28
|
+
<remotePoll>false</remotePoll>
|
37
29
|
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
|
38
30
|
<gitTool>Default</gitTool>
|
39
31
|
<submoduleCfg class="list"/>
|
40
32
|
<relativeTargetDir></relativeTargetDir>
|
33
|
+
<reference></reference>
|
41
34
|
<excludedRegions></excludedRegions>
|
42
35
|
<excludedUsers></excludedUsers>
|
36
|
+
<gitConfigName></gitConfigName>
|
37
|
+
<gitConfigEmail></gitConfigEmail>
|
43
38
|
<skipTag>false</skipTag>
|
39
|
+
<scmName></scmName>
|
44
40
|
</scm>
|
45
41
|
<canRoam>true</canRoam>
|
46
42
|
<disabled>false</disabled>
|
@@ -23,7 +23,7 @@ user "postgres"
|
|
23
23
|
|
24
24
|
run_unless_marker_file_exists("postgres_9_0_4") do
|
25
25
|
execute "download postgres src" do
|
26
|
-
command "mkdir -p #{src_dir} && curl -Lsf http://
|
26
|
+
command "mkdir -p #{src_dir} && curl -Lsf http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2 | tar xvj -C#{src_dir} --strip 1"
|
27
27
|
end
|
28
28
|
|
29
29
|
execute "config" do
|
@@ -14,7 +14,7 @@ server:
|
|
14
14
|
security_group: ci_servers
|
15
15
|
name: # run 'rake ci:server_start to populate'
|
16
16
|
instance_id: # run 'rake ci:server_start to populate'
|
17
|
-
build_command: ./
|
17
|
+
build_command: ./script/ci_build.sh
|
18
18
|
ec2_server_access:
|
19
19
|
key_pair_name: NAME_OF_YOUR_KEY_PAIR # like myapp_ci
|
20
20
|
id_rsa_path: ~/.ssh/id_rsa
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
source $HOME/.rvm/scripts/rvm && source .rvmrc
|
4
|
+
|
5
|
+
# install bundler if necessary
|
6
|
+
gem list --local bundler | grep bundler || gem install bundler || exit 1
|
7
|
+
|
8
|
+
# debugging info
|
9
|
+
echo USER=$USER && ruby --version && which ruby && which bundle
|
10
|
+
|
11
|
+
# conditionally install project gems from Gemfile
|
12
|
+
bundle check || bundle install || exit 1
|
13
|
+
|
14
|
+
RAILS_ENV=development rake db:version > /dev/null || rake db:create
|
15
|
+
RAILS_ENV=test rake db:version > /dev/null || rake db:create
|
16
|
+
|
17
|
+
RAILS_ENV=development rake db:migrate test:prepare
|
18
|
+
|
19
|
+
rake ci:headlessly['rake spec'] && rake ci:headlessly['rake jasmine:ci']
|
data/lib/lobot/tasks/ci.rake
CHANGED
@@ -81,7 +81,7 @@ namespace :ci do
|
|
81
81
|
until socket
|
82
82
|
begin
|
83
83
|
socket = TCPSocket.open(aws_conf['server']['elastic_ip'], 22)
|
84
|
-
rescue Errno::ECONNREFUSED
|
84
|
+
rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT
|
85
85
|
STDOUT << "."
|
86
86
|
STDOUT.flush
|
87
87
|
sleep 1
|
@@ -196,4 +196,18 @@ namespace :ci do
|
|
196
196
|
puts "CC Menu Config:"
|
197
197
|
puts "\tURL:\thttp://#{ci_conf['basic_auth'][0]['username']}:#{ci_conf['basic_auth'][0]['password']}@#{ci_conf['server']['elastic_ip']}/cc.xml"
|
198
198
|
end
|
199
|
+
|
200
|
+
desc "Run a command with a virtual frame buffer"
|
201
|
+
task :headlessly, :command do |task, args|
|
202
|
+
exit_code = nil
|
203
|
+
# headless is your friend on linux - http://www.aentos.com/blog/easy-setup-your-cucumber-scenarios-using-headless-gem-run-selenium-your-ci-server
|
204
|
+
Headless.ly(:display => 42) do |headless|
|
205
|
+
begin
|
206
|
+
exit_code = system(args[:command])
|
207
|
+
ensure
|
208
|
+
headless.destroy
|
209
|
+
end
|
210
|
+
end
|
211
|
+
exit exit_code
|
212
|
+
end
|
199
213
|
end
|
data/lib/lobot/version.rb
CHANGED
data/spec/install_spec.rb
CHANGED
@@ -22,9 +22,8 @@ describe Lobot::InstallGenerator do
|
|
22
22
|
assert_file "script/ci_build.sh"
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
26
|
-
|
27
|
-
rakefile_contents.should include("task :build")
|
25
|
+
it "makes ci_build.sh executable" do
|
26
|
+
system("test -x #{destination_root}/script/ci_build.sh").should == true
|
28
27
|
end
|
29
28
|
|
30
29
|
context "Capfile exists" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lobot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 53
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 7
|
10
|
+
version: 0.9.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthew Kocher & Lee Edwards
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-03-02 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: fog
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-run-script.erb
|
149
149
|
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/postgres-run-script.erb
|
150
150
|
- lib/generators/lobot/templates/ci.yml
|
151
|
+
- lib/generators/lobot/templates/ci_build.sh
|
151
152
|
- lib/generators/lobot/templates/deploy-ci.rb
|
152
153
|
- lib/generators/lobot/templates/soloistrc
|
153
154
|
- lib/lobot.rb
|