Permalink
Browse files

Strip all trailing whitespace

  • Loading branch information...
1 parent b355479 commit 1ec7cb636c81dcdf276e95618e1051dccf589571 Michael Schubert & Trace Wax committed Apr 10, 2012
Showing with 102 additions and 102 deletions.
  1. +1 −1 LICENSE.txt
  2. +8 −8 README.md
  3. +3 −3 docs/ci_yml.md
  4. +3 −3 features/ci.feature
  5. +3 −3 features/config/secrets.yml.example
  6. +1 −1 features/step_definitions/ci_steps.rb
  7. +1 −1 features/support/env.rb
  8. +5 −5 lib/generators/lobot/install_generator.rb
  9. +2 −2 lib/generators/lobot/templates/Capfile
  10. +2 −2 lib/generators/lobot/templates/bootstrap_server.sh
  11. +1 −1 lib/generators/lobot/templates/capistrano-ci.rb
  12. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/attributes/nginx.rb
  13. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/libraries/ci_config.rb
  14. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/default.rb
  15. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/git_config.rb
  16. +2 −2 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb
  17. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
  18. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/xvfb.rb
  19. +1 −1 ...generators/lobot/templates/chef/cookbooks/pivotal_ci/templates/default/jenkins-job-config.xml.erb
  20. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/files/default/cacert.pem
  21. +10 −10 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/libraries/marker.rb
  22. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/ca_cert.rb
  23. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/daemontools.rb
  24. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/libxml_prereqs.rb
  25. +6 −6 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mysql_5_1.rb
  26. +2 −2 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mysql_5_5.rb
  27. +3 −3 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/node_js.rb
  28. +6 −6 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/postgres.rb
  29. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/sqlite.rb
  30. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/swap.rb
  31. +5 −5 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-conf.erb
  32. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-htaccess.erb
  33. +1 −1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-run-script.erb
  34. +1 −1 ...enerators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/postgres-run-script.erb
  35. +4 −4 lib/generators/lobot/templates/ci.yml
  36. +1 −1 lib/generators/lobot/templates/ci_build.sh
  37. +1 −1 lib/generators/lobot/templates/deploy-ci.rb
  38. +1 −1 lib/generators/lobot/templates/soloistrc
  39. +1 −1 lib/lobot.rb
  40. +1 −1 lib/lobot/railtie.rb
  41. +1 −1 lib/lobot/tasks/ci.rake
  42. +1 −1 lobot.gemspec
  43. +10 −10 spec/install_spec.rb
  44. +1 −1 spec/spec_helper.rb
View
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+THE SOFTWARE.
View
@@ -19,7 +19,7 @@ all you'll need to do is:
rake ci:server_start
cap ci bootstrap
cap ci chef
-
+
Read on for an explanation of what each one of these steps does.
## Install
@@ -37,29 +37,29 @@ Lobot is a Rails 3 generator. Rails 2 can be made to work, but you will need to
Edit config/ci.yml
- ---
+ ---
app_name: # a short name for your application
app_user: # the user created to run your CI process
git_location: # The location of your remote git repository which Jenkins will poll and pull from on changes.
- basic_auth:
+ basic_auth:
- username: # The username you will use to access the Jenkins web interface
password: # The password you will use to access the Jenkins web interface
- credentials:
+ credentials:
aws_access_key_id: # The Access Key for your Amazon AWS account
aws_secret_access_key: The Secret Access Key for your Amazon AWS account
provider: AWS # leave this one alone
- server:
+ server:
name: run 'rake ci:server_start to populate'
instance_id: run 'rake ci:server_start to populate'
build_command: ./script/ci_build.sh
- ec2_server_access:
+ ec2_server_access:
key_pair_name: myapp_ci
id_rsa_path: ~/.ssh/id_rsa
id_rsa_for_github_access: |-
-----BEGIN RSA PRIVATE KEY-----
SSH KEY WITH ACCESS TO GITHUB GOES HERE
-----END RSA PRIVATE KEY-----
-
+
For security, you can add ci.yml to your .gitignore file and store a ci.yml.example without authentication credentials in your repository
## Modify the soloistrc if necessary
@@ -75,7 +75,7 @@ Launch an instance, allocate and associates an elastic IP and updates ci.yml:
Bootstrap the instance using the boostrap_server.sh script generated by Lobot. The script instals ruby prerequisites, creates the app_user account, and installs RVM for that user:
cap ci bootstrap
-
+
Upload the contents of your chef/cookbooks/ directory, upload the soloistrc, and run chef:
cap ci chef
View
@@ -15,7 +15,7 @@ The basic auth field is an array of hashes containing the usernames and password
# credentials:
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.
## aws_access_key_id:
-The Access Key for your Amazon AWS account. You can obtain it by visiting
+The Access Key for your Amazon AWS account. You can obtain it by visiting
https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key
## aws_secret_access_key: The Secret Access Key for your Amazon AWS account
This will be available at the same URL.
@@ -32,7 +32,7 @@ The instance_id is also saved, in order to facilitate stopping and starting inst
# build_command: ./script/ci_build.sh
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.
-# ec2_server_access:
+# ec2_server_access:
key_pair_name: myapp_ci
id_rsa_path: ~/.ssh/id_rsa
@@ -44,4 +44,4 @@ id_rsa_for_github_access: |-
SSH KEY WITH ACCESS TO GITHUB GOES HERE
-----END RSA PRIVATE KEY-----
-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.
+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.
View
@@ -1,17 +1,17 @@
-Feature: CI
+Feature: CI
Background:
Given the temp directory is clean
Given I am in the temp directory
-
+
Scenario: Installing Lobot on a rails3 project
When I create a new Rails project using a Rails template
And I vendor Lobot
And I put Lobot in the Gemfile
And I run bundle install
And I run the Lobot generator
Then rake reports ci tasks as being available
-
+
Scenario: Install CI on Amazon AWS using new Rails template
When I create a new Rails project using a Rails template
And I vendor Lobot
@@ -1,7 +1,7 @@
----
+---
aws_access_key_id:
-aws_secret_access_key:
+aws_secret_access_key:
id_rsa_for_github_access: |-
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
-
+
@@ -46,7 +46,7 @@ def system!(str)
When /^I enter my info into the ci\.yml file$/ do
secrets = YAML.load_file(File.expand_path('../config/secrets.yml', File.dirname(__FILE__)))
-
+
ci_conf_location = 'testapp/config/ci.yml'
ci_yml = YAML.load_file(ci_conf_location)
ci_yml.merge!(
View
@@ -1,3 +1,3 @@
require "rubygems"
-require File.expand_path('../../lib/lobot', File.dirname(__FILE__))
+require File.expand_path('../../lib/lobot', File.dirname(__FILE__))
@@ -1,7 +1,7 @@
module Lobot
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
-
+
def create_ci_files
template 'ci.yml', 'config/ci.yml'
template 'bootstrap_server.sh', 'script/bootstrap_server.sh'
@@ -11,15 +11,15 @@ def create_ci_files
template 'ci_build.sh', 'script/ci_build.sh'
system "chmod a+x #{destination_root}/script/ci_build.sh"
end
-
+
def add_load_path_to_capfile
template 'Capfile', 'Capfile' unless File.exists?("#{destination_root}/Capfile")
prepend_to_file 'Capfile', "load 'config/capistrano/ci'\n"
end
-
+
def create_chef_cookbooks
directory 'chef', 'chef'
end
-
+
end
-end
+end
@@ -2,5 +2,5 @@
# load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
-#
-# load 'config/deploy' # remove this line to skip loading any of the default tasks
+#
+# load 'config/deploy' # remove this line to skip loading any of the default tasks
@@ -17,7 +17,7 @@ grep -sq "$authorized_keys_string" /home/$APP_USER/.ssh/authorized_keys || cat /
## enable ssh password auth
-perl -p -i -e 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
+perl -p -i -e 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
/etc/init.d/sshd reload
# install epel
@@ -54,4 +54,4 @@ BOOTSTRAP_AS_USER
chmod a+x /home/$APP_USER/bootstrap_as_user.sh
su - $APP_USER /home/$APP_USER/bootstrap_as_user.sh $APP_USER
-rm /home/$APP_USER/bootstrap_as_user.sh
+rm /home/$APP_USER/bootstrap_as_user.sh
@@ -4,7 +4,7 @@
task :ci_setup do
ci_conf_location ||= File.expand_path('../../../config/ci.yml', __FILE__)
ci_conf ||= YAML.load_file(ci_conf_location)
-
+
raise "rvm_ruby_string not set - are you using RVM" unless ENV['rvm_ruby_string']
set :rvm_ruby_string, ENV['rvm_ruby_string']
set :rvm_type, :user
@@ -1,2 +1,2 @@
node["nginx_settings"] ||= {}
-node["nginx_settings"]["basic_auth_users"] = CI_CONFIG['basic_auth']
+node["nginx_settings"]["basic_auth_users"] = CI_CONFIG['basic_auth']
@@ -1,2 +1,2 @@
ci_conf_location = File.expand_path('../../../../../ci.yml', __FILE__)
-::CI_CONFIG = YAML.load_file(ci_conf_location)
+::CI_CONFIG = YAML.load_file(ci_conf_location)
@@ -7,4 +7,4 @@
include_recipe "pivotal_server::ca_cert"
include_recipe "pivotal_server::node_js"
include_recipe "pivotal_ci::id_rsa"
-include_recipe "pivotal_ci::jenkins"
+include_recipe "pivotal_ci::jenkins"
@@ -8,4 +8,4 @@
execute "set git user" do
command "git config --global user.name 'Jenkins CI Server'"
user username
-end
+end
@@ -8,7 +8,7 @@
end
execute "add github to known hosts if necessary" do
- github_string = 'github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=='
+ github_string = 'github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=='
command "echo '#{github_string}' >> /home/#{username}/.ssh/known_hosts"
not_if "grep '#{github_string}' /home/#{username}/.ssh/known_hosts"
-end
+end
@@ -42,4 +42,4 @@
execute "make run script executable" do
command "chmod 755 /service/#{service_name}/run"
-end
+end
@@ -4,4 +4,4 @@
execute "install firefox" do
command "yum -y install firefox"
-end
+end
@@ -55,4 +55,4 @@
</builders>
<publishers/>
<buildWrappers/>
-</project>
+</project>
@@ -3718,4 +3718,4 @@ mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW
QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY
T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny
Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==
------END CERTIFICATE-----
+-----END CERTIFICATE-----
@@ -1,10 +1,10 @@
class Chef::Recipe
-
+
MARKER_DIR = "#{ENV['HOME']}/.install_markers"
-
+
#Regarding marker files:
#
- #The idea here is you have a simple "signal" on disk that tells you when you've
+ #The idea here is you have a simple "signal" on disk that tells you when you've
#successfully run something, and you don't want to run it again if you don't have to.
#
#Also, the decision to rerun a unit of work becomes explicit - and owned by you.
@@ -15,28 +15,28 @@ class Chef::Recipe
#i.e. what markers are there and what are their timestamps?
#
#And reinstalls are easy - just rm the relevant marker file.
-
+
def run_unless_marker_file_exists(marker_file_name)
directory MARKER_DIR do
# owner WS_USER
recursive true
end
-
+
marker_path = File.join(MARKER_DIR, marker_file_name)
if File.exists?(marker_path)
log "skipping #{marker_file_name}: marker file found (#{marker_path}), detail: #{`ls -la #{marker_path}`.strip}"
else
-
+
log "no marker file found for #{marker_file_name} in #{MARKER_DIR}, running"
-
+
yield
-
+
execute "touching marker file #{marker_path} after successful run" do
# user WS_USER
command "touch #{marker_path}"
end
-
+
end
end
-end
+end
@@ -1,4 +1,4 @@
cookbook_file "/etc/pki/tls/certs/ca-bundle.crt" do
source "cacert.pem"
mode "0444"
-end
+end
@@ -12,4 +12,4 @@
execute "make sure daemontools is installed" do
command "ls /command/svscanboot"
-end
+end
@@ -9,4 +9,4 @@
# arch arch_string
end
end
-end
+end
@@ -22,26 +22,26 @@
execute "download mysql src" do
command "mkdir -p #{src_dir} && curl -Lsf http://mysql.he.net/Downloads/MySQL-5.1/mysql-5.1.57.tar.gz | tar xvz -C#{src_dir} --strip 1"
end
-
+
execute "configure" do
command "./configure --prefix=/usr/local/mysql --with-plugins=innobase,myisam"
cwd src_dir
end
-
+
execute "make" do
command "make"
cwd src_dir
end
-
+
execute "make install" do
command "make install"
cwd src_dir
end
-
+
execute "mysql owns #{install_dir}" do
command "chown -R mysql #{install_dir}"
end
-
+
execute "install db" do
command "#{install_dir}/bin/mysql_install_db --user=mysql"
cwd install_dir
@@ -93,7 +93,7 @@
execute "create app_user user" do
command "#{install_dir}/bin/mysql -u root -p#{mysql_root_password} -D mysql -r -B -N -e \"CREATE USER '#{mysql_user_name}'@'localhost'\""
not_if "#{install_dir}/bin/mysql -u root -p#{mysql_root_password} -D mysql -r -B -N -e \"SELECT * FROM user where User='#{mysql_user_name}' and Host = 'localhost'\" | grep -q #{mysql_user_name}"
-end
+end
execute "set password for app_user" do
command "#{install_dir}/bin/mysql -u root -p#{mysql_root_password} -D mysql -r -B -N -e \"SET PASSWORD FOR '#{mysql_user_name}'@'localhost' = PASSWORD('#{mysql_user_password}')\""
@@ -33,7 +33,7 @@
command "make install"
cwd src_dir
end
-
+
execute "mysql owns #{install_dir}/data" do
command "chown -R mysql #{install_dir}/data"
end
@@ -75,7 +75,7 @@
execute "create app_user user" do
command "#{install_dir}/bin/mysql -u root -p#{mysql_root_password} -D mysql -r -B -N -e \"CREATE USER '#{mysql_user_name}'@'localhost'\""
not_if "#{install_dir}/bin/mysql -u root -p#{mysql_root_password} -D mysql -r -B -N -e \"SELECT * FROM user where User='#{mysql_user_name}' and Host = 'localhost'\" | grep -q #{mysql_user_name}"
-end
+end
execute "set password for app_user" do
command "#{install_dir}/bin/mysql -u root -p#{mysql_root_password} -D mysql -r -B -N -e \"SET PASSWORD FOR '#{mysql_user_name}'@'localhost' = PASSWORD('#{mysql_user_password}')\""
Oops, something went wrong.

0 comments on commit 1ec7cb6

Please sign in to comment.