lobot 2.0.0pre → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -10
- data/.gitmodules +1 -1
- data/.pairs +15 -0
- data/.rvmrc +1 -1
- data/.travis.yml +5 -0
- data/Gemfile +2 -2
- data/LICENSE.txt +1 -1
- data/README.md +67 -29
- data/Rakefile +11 -6
- data/Vagrantfile +8 -5
- data/bin/lobot +2 -4
- data/chef/cookbooks/pivotal_ci/attributes/jenkins.rb +1 -0
- data/chef/cookbooks/pivotal_ci/files/default/tests/minitest/default_test.rb +40 -2
- data/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb +5 -0
- data/chef/cookbooks/pivotal_ci/recipes/jenkins_config.rb +5 -2
- data/chef/cookbooks/pivotal_ci/recipes/limited_travis_ci_environment.rb +4 -0
- data/chef/cookbooks/pivotal_ci/templates/default/jenkins-job-config.xml.erb +8 -6
- data/chef/cookbooks/pivotal_ci/test/kitchen/cookbooks/pivotal_ci_test/attributes/default.rb +0 -1
- data/chef/cookbooks/pivotal_ci/test/kitchen/cookbooks/pivotal_ci_test/recipes/bootstrap.rb +41 -0
- data/chef/cookbooks/pivotal_ci/test/kitchen/cookbooks/pivotal_ci_test/recipes/default.rb +1 -41
- data/chef/travis-cookbooks/ci_environment/apt/recipes/default.rb +8 -7
- data/chef/travis-cookbooks/ci_environment/bazaar/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/cassandra/attributes/default.rb +6 -3
- data/chef/travis-cookbooks/ci_environment/cassandra/recipes/datastax.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/cassandra/recipes/package.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/cassandra/recipes/tarball.rb +6 -2
- data/chef/travis-cookbooks/ci_environment/cassandra/templates/default/cassandra.init.erb +58 -131
- data/chef/travis-cookbooks/ci_environment/chromium/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/clang/attributes/tarball.rb +2 -7
- data/chef/travis-cookbooks/ci_environment/clang/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/clang/recipes/tarball.rb +2 -4
- data/chef/travis-cookbooks/ci_environment/couchdb/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/couchdb/recipes/ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/couchdb/recipes/ubuntu-12.04.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/couchdb/recipes/ubuntu1110_ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/couchdb/recipes/ubuntu1204_ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/doxygen/recipes/default.rb +24 -0
- data/chef/travis-cookbooks/ci_environment/elasticsearch/attributes/default.rb +4 -1
- data/chef/travis-cookbooks/ci_environment/elasticsearch/recipes/default.rb +8 -5
- data/chef/travis-cookbooks/ci_environment/emacs/recipes/nox.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/firefox/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/git/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/git/recipes/ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/golang/attributes/default.rb +3 -3
- data/chef/travis-cookbooks/ci_environment/gradle/attributes/tarball.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/haskell/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/haskell/recipes/ghc_package.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/haskell/recipes/ghc_source.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/haskell/recipes/platform_package.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/haskell/recipes/platform_ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/haskell/recipes/platform_source.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/haskell/recipes/source.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/hbase/recipes/cdh4.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/java/attributes/default.rb +4 -2
- data/chef/travis-cookbooks/ci_environment/java/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/java/recipes/oraclejdk7.rb +6 -1
- data/chef/travis-cookbooks/ci_environment/kerl/attributes/source.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/kerl/files/default/erlang.cookie +1 -0
- data/chef/travis-cookbooks/ci_environment/kerl/recipes/source.rb +8 -0
- data/chef/travis-cookbooks/ci_environment/kestrel/recipes/tarball.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/leiningen/attributes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/leiningen/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/leiningen/recipes/lein1x.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/leiningen/recipes/lein2x.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libffi/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libgdbm/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libncurses/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libossp-uuid/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libreadline/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libssl/recipes/098.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libssl/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/libxml/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/lighttpd/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/maven3/recipes/default.rb +5 -2
- data/chef/travis-cookbooks/ci_environment/maven3/recipes/package.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/maven3/recipes/ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/maven3/recipes/tarball.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/memcached/attributes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/memcached/attributes/ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/memcached/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/memcached/recipes/ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/mercurial/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/mercurial/recipes/ppa.rb +36 -0
- data/chef/travis-cookbooks/ci_environment/mongodb/attributes/mongodb.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/mongodb/files/default/mongodb.sysvinit.sh +1 -1
- data/chef/travis-cookbooks/ci_environment/mongodb/recipes/apt.rb +5 -5
- data/chef/travis-cookbooks/ci_environment/mongodb/recipes/server.rb +5 -2
- data/chef/travis-cookbooks/ci_environment/mysql/attributes/default.rb +1 -3
- data/chef/travis-cookbooks/ci_environment/mysql/recipes/server_on_ramfs.rb +6 -1
- data/chef/travis-cookbooks/ci_environment/mysql/templates/default/my.cnf.erb +0 -2
- data/chef/travis-cookbooks/ci_environment/mysql/templates/default/ramfs/my.cnf.erb +0 -2
- data/chef/travis-cookbooks/ci_environment/neo4j-server/attributes/tarball.rb +13 -2
- data/chef/travis-cookbooks/ci_environment/neo4j-server/recipes/tarball.rb +26 -2
- data/chef/travis-cookbooks/ci_environment/networking_basic/recipes/default.rb +4 -1
- data/chef/travis-cookbooks/ci_environment/nodejs/attributes/multi.rb +3 -3
- data/chef/travis-cookbooks/ci_environment/nodejs/recipes/multi.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/openssh/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/perlbrew/attributes/multi.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/phantomjs/attributes/default.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/phantomjs/metadata.rb +3 -0
- data/chef/travis-cookbooks/ci_environment/phantomjs/recipes/default.rb +3 -1
- data/chef/travis-cookbooks/ci_environment/phantomjs/recipes/tarball.rb +3 -2
- data/chef/travis-cookbooks/ci_environment/php/attributes/default.rb +40 -2
- data/chef/travis-cookbooks/ci_environment/php/providers/pecl.rb +73 -0
- data/chef/travis-cookbooks/ci_environment/php/recipes/extensions.rb +25 -0
- data/chef/travis-cookbooks/ci_environment/php/recipes/multi.rb +5 -4
- data/chef/travis-cookbooks/ci_environment/php/resources/pecl.rb +10 -0
- data/chef/travis-cookbooks/ci_environment/phpbuild/attributes/default.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/phpbuild/files/default/after-install.d/phpunit.sh +58 -0
- data/chef/travis-cookbooks/ci_environment/phpbuild/files/default/definitions/5.2.17 +3 -1
- data/chef/travis-cookbooks/ci_environment/phpbuild/files/default/definitions/5.3.3 +2 -1
- data/chef/travis-cookbooks/ci_environment/phpbuild/providers/build.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/phpbuild/recipes/default.rb +8 -10
- data/chef/travis-cookbooks/ci_environment/phpbuild/templates/default/default_configure_options.erb +4 -0
- data/chef/travis-cookbooks/ci_environment/phpenv/attributes/default.rb +6 -0
- data/chef/travis-cookbooks/ci_environment/phpenv/recipes/default.rb +11 -7
- data/chef/travis-cookbooks/ci_environment/postgresql/recipes/server_on_ramfs.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/python/attributes/default.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/python/recipes/multi.rb +10 -3
- data/chef/travis-cookbooks/ci_environment/rabbitmq/attributes/default.rb +3 -0
- data/chef/travis-cookbooks/ci_environment/rabbitmq/recipes/default.rb +6 -2
- data/chef/travis-cookbooks/ci_environment/ragel/recipes/custom.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/ragel/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/redis/attributes/default.rb +3 -0
- data/chef/travis-cookbooks/ci_environment/redis/recipes/default.rb +6 -3
- data/chef/travis-cookbooks/ci_environment/redis/recipes/ppa.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/riak/attributes/default.rb +1 -0
- data/chef/travis-cookbooks/ci_environment/riak/attributes/package.rb +3 -3
- data/chef/travis-cookbooks/{messaging_broker/openssl/recipes/default.rb → ci_environment/riak/attributes/service.rb} +4 -3
- data/chef/travis-cookbooks/ci_environment/riak/recipes/config.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/riak/recipes/default.rb +12 -5
- data/chef/travis-cookbooks/ci_environment/rvm/attributes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/rvm/attributes/multi.rb +2 -0
- data/chef/travis-cookbooks/ci_environment/rvm/files/default/gemsets/global.gems +1 -1
- data/chef/travis-cookbooks/ci_environment/rvm/files/default/gemsets/jruby/global.gems +1 -1
- data/chef/travis-cookbooks/ci_environment/rvm/files/default/gemsets/ruby/2.0.0/global.gems +2 -0
- data/chef/travis-cookbooks/ci_environment/rvm/files/default/gemsets/ruby/head/global.gems +2 -0
- data/chef/travis-cookbooks/ci_environment/rvm/recipes/default.rb +23 -1
- data/chef/travis-cookbooks/ci_environment/rvm/recipes/multi.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/rvm/templates/default/bundler_config.yml.erb +2 -0
- data/chef/travis-cookbooks/ci_environment/sbt/CHANGELOG.md +20 -0
- data/chef/travis-cookbooks/ci_environment/sbt/LICENSE +201 -0
- data/chef/travis-cookbooks/ci_environment/sbt/README.md +78 -2
- data/chef/travis-cookbooks/ci_environment/sbt/attributes/default.rb +36 -10
- data/chef/travis-cookbooks/ci_environment/sbt/metadata.json +27 -17
- data/chef/travis-cookbooks/ci_environment/sbt/metadata.rb +13 -6
- data/chef/travis-cookbooks/ci_environment/sbt/recipes/default.rb +101 -51
- data/chef/travis-cookbooks/ci_environment/sbt/templates/default/jvmopts.erb +7 -0
- data/chef/travis-cookbooks/ci_environment/sbt/templates/default/sbtopts.erb +54 -0
- data/chef/travis-cookbooks/ci_environment/sphinx/attributes/default.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/sphinx/metadata.rb +4 -4
- data/chef/travis-cookbooks/ci_environment/sphinx/recipes/all.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/sphinx/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/{messaging_broker/build-essential/recipes/default.rb → ci_environment/sqlite/recipes/ppa.rb} +13 -24
- data/chef/travis-cookbooks/ci_environment/subversion/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/sweeper/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/travis_build_environment/attributes/default.rb +2 -0
- data/chef/travis-cookbooks/ci_environment/travis_build_environment/recipes/ci_user.rb +2 -2
- data/chef/travis-cookbooks/ci_environment/travis_build_environment/recipes/default.rb +1 -3
- data/chef/travis-cookbooks/ci_environment/travis_build_environment/recipes/root.rb +5 -1
- data/chef/travis-cookbooks/ci_environment/travis_build_environment/templates/default/ci_user/{dot_bashrc.sh → dot_bashrc.sh.erb} +0 -4
- data/chef/travis-cookbooks/ci_environment/unarchivers/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/xserver/metadata.rb +3 -0
- data/chef/travis-cookbooks/ci_environment/xserver/recipes/default.rb +1 -1
- data/chef/travis-cookbooks/ci_environment/zeromq/recipes/default.rb +6 -23
- data/chef/travis-cookbooks/ci_environment/zeromq/recipes/{20x.rb → ppa.rb} +14 -14
- data/chef/travis-cookbooks/ci_environment/zookeeper/recipes/cdh4.rb +1 -1
- data/chef/travis-cookbooks/worker_host/java/metadata.rb +1 -1
- data/chef/travis-cookbooks/worker_host/java/recipes/openjdk.rb +6 -0
- data/chef/travis-cookbooks/worker_host/jruby/attributes/default.rb +1 -1
- data/chef/travis-cookbooks/worker_host/jruby/metadata.rb +1 -1
- data/chef/travis-cookbooks/worker_host/jruby/recipes/default.rb +1 -0
- data/chef/travis-cookbooks/worker_host/monit/recipes/default.rb +21 -17
- data/chef/travis-cookbooks/worker_host/networking_basic/metadata.rb +1 -1
- data/chef/travis-cookbooks/worker_host/networking_basic/recipes/default.rb +0 -6
- data/chef/travis-cookbooks/worker_host/ntp/.gitignore +1 -0
- data/chef/travis-cookbooks/worker_host/ntp/.travis.yml +6 -0
- data/chef/travis-cookbooks/worker_host/ntp/CHANGELOG.md +35 -0
- data/chef/travis-cookbooks/worker_host/ntp/CONTRIBUTING +29 -0
- data/chef/travis-cookbooks/worker_host/ntp/LICENSE +201 -0
- data/chef/travis-cookbooks/worker_host/ntp/README.md +163 -0
- data/chef/travis-cookbooks/worker_host/ntp/Rakefile +19 -0
- data/chef/travis-cookbooks/worker_host/ntp/TESTING.md +213 -0
- data/chef/travis-cookbooks/worker_host/ntp/attributes/default.rb +54 -0
- data/chef/travis-cookbooks/{messaging_broker/rabbitmq/resources/vhost.rb → worker_host/ntp/attributes/ntpdate.rb} +6 -7
- data/chef/travis-cookbooks/worker_host/ntp/chefignore +19 -0
- data/chef/travis-cookbooks/worker_host/ntp/files/default/ntp.leapseconds +222 -0
- data/chef/travis-cookbooks/worker_host/ntp/metadata.json +117 -0
- data/chef/travis-cookbooks/worker_host/ntp/metadata.rb +45 -0
- data/chef/travis-cookbooks/worker_host/ntp/recipes/default.rb +50 -0
- data/chef/travis-cookbooks/worker_host/ntp/recipes/disable.rb +22 -0
- data/chef/travis-cookbooks/worker_host/ntp/recipes/ntpdate.rb +36 -0
- data/chef/travis-cookbooks/{messaging_broker/openssl/libraries/secure_password.rb → worker_host/ntp/recipes/undo.rb} +17 -18
- data/chef/travis-cookbooks/worker_host/ntp/templates/default/ntp.conf.erb +55 -0
- data/chef/travis-cookbooks/worker_host/ntp/templates/default/ntpdate.erb +14 -0
- data/chef/travis-cookbooks/worker_host/rvm/recipes/multi.rb +1 -1
- data/chef/travis-cookbooks/worker_host/travis_worker/attributes/default.rb +10 -3
- data/chef/travis-cookbooks/worker_host/travis_worker/files/default/signal_wrapper.rb +22 -0
- data/chef/travis-cookbooks/worker_host/travis_worker/metadata.rb +2 -2
- data/chef/travis-cookbooks/worker_host/travis_worker/recipes/bluebox.rb +97 -0
- data/chef/travis-cookbooks/worker_host/travis_worker/recipes/default.rb +25 -15
- data/chef/travis-cookbooks/worker_host/travis_worker/templates/default/sv-travis-worker-run.erb +1 -1
- data/chef/travis-cookbooks/worker_host/travis_worker/templates/default/worker-bluebox.yml.erb +21 -0
- data/chef/travis-cookbooks/worker_host/travis_worker/templates/default/worker.yml.erb +0 -4
- data/chef/travis-cookbooks/worker_host/travis_worker_collectd/metadata.rb +1 -0
- data/chef/travis-cookbooks/worker_host/travis_worker_collectd/recipes/bluebox.rb +15 -0
- data/chef/travis-cookbooks/worker_host/travis_worker_collectd/recipes/default.rb +1 -0
- data/chef/travis-cookbooks/worker_host/users/recipes/default.rb +5 -0
- data/cookbooks/.gitkeep +3 -0
- data/lib/lobot.rb +8 -4
- data/lib/lobot/amazon.rb +33 -19
- data/lib/lobot/cli.rb +70 -46
- data/lib/lobot/config.rb +151 -19
- data/lib/lobot/configuration_wizard.rb +117 -0
- data/lib/lobot/keychain.rb +36 -0
- data/lib/lobot/password.rb +13 -0
- data/lib/lobot/sobo.rb +57 -13
- data/lib/lobot/templates/default_rails_build_script.sh +13 -0
- data/lib/lobot/version.rb +2 -2
- data/lobot.gemspec +4 -5
- data/script/bootstrap_server.sh +1 -1
- data/script/ci_build.sh +13 -0
- data/spec/assets/test_cert.crt +18 -0
- data/spec/fixtures/ssh_keys/vagrant_test_key +27 -0
- data/spec/fixtures/ssh_keys/vagrant_test_key.pub +1 -0
- data/spec/lib/lobot/amazon_spec.rb +80 -39
- data/spec/lib/lobot/cli_spec.rb +223 -154
- data/spec/lib/lobot/config_spec.rb +207 -5
- data/spec/lib/lobot/configuration_wizard_spec.rb +347 -0
- data/spec/lib/lobot/keychain_spec.rb +33 -0
- data/spec/lib/lobot/password_spec.rb +15 -0
- data/spec/spec_helper.rb +19 -1
- data/templates/Gemfile-remote +4 -0
- metadata +83 -100
- data/chef/travis-cookbooks/ci_environment/rvm/files/default/gemsets/ruby/1.8.6/global.gems +0 -2
- data/chef/travis-cookbooks/ci_environment/travis_build_environment/files/default/root/dot_bashrc.sh +0 -86
- data/chef/travis-cookbooks/ci_environment/zeromq/attributes/default.rb +0 -7
- data/chef/travis-cookbooks/messaging_broker/build-essential/README.md +0 -24
- data/chef/travis-cookbooks/messaging_broker/build-essential/metadata.rb +0 -10
- data/chef/travis-cookbooks/messaging_broker/emacs/metadata.rb +0 -11
- data/chef/travis-cookbooks/messaging_broker/emacs/recipes/default.rb +0 -21
- data/chef/travis-cookbooks/messaging_broker/erlang/attributes/default.rb +0 -1
- data/chef/travis-cookbooks/messaging_broker/erlang/metadata.rb +0 -11
- data/chef/travis-cookbooks/messaging_broker/erlang/recipes/default.rb +0 -27
- data/chef/travis-cookbooks/messaging_broker/git/README.rdoc +0 -37
- data/chef/travis-cookbooks/messaging_broker/git/metadata.rb +0 -16
- data/chef/travis-cookbooks/messaging_broker/git/recipes/default.rb +0 -24
- data/chef/travis-cookbooks/messaging_broker/git/recipes/server.rb +0 -34
- data/chef/travis-cookbooks/messaging_broker/git/templates/default/sv-git-daemon-log-run.erb +0 -2
- data/chef/travis-cookbooks/messaging_broker/git/templates/default/sv-git-daemon-run.erb +0 -3
- data/chef/travis-cookbooks/messaging_broker/haproxy/README.md +0 -79
- data/chef/travis-cookbooks/messaging_broker/haproxy/attributes/default.rb +0 -22
- data/chef/travis-cookbooks/messaging_broker/haproxy/metadata.rb +0 -13
- data/chef/travis-cookbooks/messaging_broker/haproxy/recipes/app_lb.rb +0 -50
- data/chef/travis-cookbooks/messaging_broker/haproxy/recipes/default.rb +0 -42
- data/chef/travis-cookbooks/messaging_broker/haproxy/templates/default/haproxy-app_lb.cfg.erb +0 -34
- data/chef/travis-cookbooks/messaging_broker/haproxy/templates/default/haproxy-default.erb +0 -4
- data/chef/travis-cookbooks/messaging_broker/haproxy/templates/default/haproxy.cfg.erb +0 -27
- data/chef/travis-cookbooks/messaging_broker/iptables/definitions/iptables_rule.rb +0 -35
- data/chef/travis-cookbooks/messaging_broker/iptables/files/default/rebuild-iptables +0 -284
- data/chef/travis-cookbooks/messaging_broker/iptables/metadata.rb +0 -10
- data/chef/travis-cookbooks/messaging_broker/iptables/recipes/default.rb +0 -50
- data/chef/travis-cookbooks/messaging_broker/iptables/templates/default/all_established.erb +0 -2
- data/chef/travis-cookbooks/messaging_broker/iptables/templates/default/all_icmp.erb +0 -2
- data/chef/travis-cookbooks/messaging_broker/iptables/templates/default/iptables_load.erb +0 -3
- data/chef/travis-cookbooks/messaging_broker/openssl/README.md +0 -37
- data/chef/travis-cookbooks/messaging_broker/openssl/metadata.rb +0 -8
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/README.md +0 -86
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/attributes/default.rb +0 -10
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/metadata.rb +0 -63
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/providers/user.rb +0 -66
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/providers/vhost.rb +0 -34
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/recipes/cluster.rb +0 -35
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/recipes/default.rb +0 -51
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/resources/user.rb +0 -25
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/templates/default/doterlang.cookie.erb +0 -1
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/templates/default/rabbitmq-env.conf.erb +0 -10
- data/chef/travis-cookbooks/messaging_broker/rabbitmq/templates/default/rabbitmq_cluster.config.erb +0 -5
- data/ci_build.sh +0 -20
- data/docs/ci_yml.md +0 -39
- data/features/ci.feature +0 -29
- data/features/config/secrets.yml.example +0 -4
- data/features/step_definitions/ci_steps.rb +0 -137
- data/features/support/env.rb +0 -12
- data/lib/generators/lobot/USAGE +0 -15
- data/lib/generators/lobot/config_generator.rb +0 -141
- data/lib/generators/lobot/install_generator.rb +0 -25
- data/lib/generators/lobot/templates/Capfile +0 -6
- data/lib/generators/lobot/templates/ci.yml +0 -22
- data/lib/generators/lobot/templates/ci_build.sh +0 -22
- data/lib/generators/lobot/templates/deploy-ci.rb +0 -7
- data/lib/generators/lobot/templates/soloistrc +0 -23
- data/lib/lobot/jenkins.rb +0 -17
- data/lib/lobot/railtie.rb +0 -20
- data/lib/lobot/recipes/ci.rb +0 -78
- data/lib/lobot/tasks/ci.rake +0 -93
- data/spec/lib/lobot/jenkins_spec.rb +0 -14
@@ -0,0 +1,97 @@
|
|
1
|
+
require_recipe 'runit'
|
2
|
+
require_recipe 'jruby'
|
3
|
+
|
4
|
+
users = if Chef::Config[:solo]
|
5
|
+
node[:users]
|
6
|
+
else
|
7
|
+
search(:users)
|
8
|
+
end
|
9
|
+
|
10
|
+
execute "monit-reload" do
|
11
|
+
action :nothing
|
12
|
+
command "monit reload"
|
13
|
+
end
|
14
|
+
|
15
|
+
package "ruby1.9.3" do
|
16
|
+
action :install
|
17
|
+
end
|
18
|
+
|
19
|
+
cookbook_file "/usr/local/bin/signal_wrapper" do
|
20
|
+
source "signal_wrapper.rb"
|
21
|
+
mode "0755"
|
22
|
+
owner "root"
|
23
|
+
backup false
|
24
|
+
end
|
25
|
+
|
26
|
+
1.upto(node[:travis][:worker][:workers]) do |worker|
|
27
|
+
app = "worker-#{worker}"
|
28
|
+
worker_name = "#{app}.#{node[:fqdn]}"
|
29
|
+
home = "#{node[:travis][:worker][:home]}/#{app}"
|
30
|
+
service_name = "travis-worker-#{worker}"
|
31
|
+
|
32
|
+
service service_name do
|
33
|
+
action :nothing
|
34
|
+
end
|
35
|
+
|
36
|
+
directory home do
|
37
|
+
action :create
|
38
|
+
recursive true
|
39
|
+
owner "travis"
|
40
|
+
group "travis"
|
41
|
+
mode "0755"
|
42
|
+
end
|
43
|
+
|
44
|
+
git home do
|
45
|
+
repository node[:travis][:worker][:repository]
|
46
|
+
reference node[:travis][:worker][:ref]
|
47
|
+
action :sync
|
48
|
+
user "travis"
|
49
|
+
group "travis"
|
50
|
+
notifies :restart, resources(:service => service_name)
|
51
|
+
end
|
52
|
+
|
53
|
+
directory "#{home}/log" do
|
54
|
+
action :create
|
55
|
+
owner "travis"
|
56
|
+
group "travis"
|
57
|
+
mode "0755"
|
58
|
+
end
|
59
|
+
|
60
|
+
bash "bundle gems" do
|
61
|
+
code "#{File.dirname(node[:jruby][:bin])}/bundle install --deployment --binstubs"
|
62
|
+
user "travis"
|
63
|
+
group "travis"
|
64
|
+
cwd home
|
65
|
+
end
|
66
|
+
|
67
|
+
template "#{home}/config/worker.yml" do
|
68
|
+
source "worker-bluebox.yml.erb"
|
69
|
+
owner "travis"
|
70
|
+
group "travis"
|
71
|
+
mode "0600"
|
72
|
+
variables :amqp => node[:travis][:worker][:amqp],
|
73
|
+
:worker => node[:travis][:worker],
|
74
|
+
:hostname => worker_name,
|
75
|
+
:bluebox => node[:bluebox],
|
76
|
+
:librato => node[:collectd_librato]
|
77
|
+
|
78
|
+
notifies :restart, resources(:service => service_name)
|
79
|
+
end
|
80
|
+
|
81
|
+
runit_service "travis-worker-#{worker}" do
|
82
|
+
options :jruby => node[:jruby][:bin],
|
83
|
+
:worker_home => home,
|
84
|
+
:user => "travis",
|
85
|
+
:group => "travis"
|
86
|
+
template_name "travis-worker"
|
87
|
+
end
|
88
|
+
|
89
|
+
template "/etc/monit/conf.d/travis-worker-#{worker}.monitrc" do
|
90
|
+
source "travis-worker.monitrc.erb"
|
91
|
+
owner "root"
|
92
|
+
group "root"
|
93
|
+
mode "0644"
|
94
|
+
variables :home => home
|
95
|
+
notifies :run, resources(:execute => 'monit-reload')
|
96
|
+
end
|
97
|
+
end
|
@@ -60,18 +60,8 @@ link "#{node[:travis][:worker][:home]}/.VirtualBox/VirtualBox.xml" do
|
|
60
60
|
}
|
61
61
|
end
|
62
62
|
|
63
|
-
if not node[:travis][:worker][:post_checkout].empty?
|
64
|
-
bash "run post checkout hook (#{node[:travis][:worker][:post_checkout][:command]})" do
|
65
|
-
code node[:travis][:worker][:post_checkout][:command]
|
66
|
-
user "travis"
|
67
|
-
not_if "cd #{node[:travis][:worker][:home]} && #{node[:travis][:worker][:post_checkout][:condition]}"
|
68
|
-
cwd node[:travis][:worker][:home]
|
69
|
-
notifies :restart, resources(:service => 'travis-worker')
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
63
|
bash "bundle gems" do
|
74
|
-
code "#{File.dirname(node[:jruby][:bin])}/bundle install --
|
64
|
+
code "#{File.dirname(node[:jruby][:bin])}/bundle install --deployment --binstubs"
|
75
65
|
user "travis"
|
76
66
|
group "travis"
|
77
67
|
cwd node[:travis][:worker][:home]
|
@@ -89,17 +79,37 @@ template "#{node[:travis][:worker][:home]}/config/worker.yml" do
|
|
89
79
|
end
|
90
80
|
|
91
81
|
bash "download VirtualBox images" do
|
92
|
-
|
82
|
+
if node[:travis][:worker][:box]
|
83
|
+
code "#{node[:jruby][:bin]} ./bin/thor travis:vms:download #{node[:travis][:worker][:box]} 2>/dev/null"
|
84
|
+
not_if {
|
85
|
+
File.exists?("#{node[:travis][:worker][:home]}/boxes/travis-#{node[:travis][:worker][:env]}-pro.box")
|
86
|
+
}
|
87
|
+
else
|
88
|
+
code "#{node[:jruby][:bin]} ./bin/thor travis:vms:download 2>/dev/null"
|
89
|
+
not_if {
|
90
|
+
File.exists?("#{node[:travis][:worker][:home]}/boxes/travis-#{node[:travis][:worker][:env]}.box")
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
93
94
|
user "travis"
|
94
95
|
group "travis"
|
95
96
|
cwd node[:travis][:worker][:home]
|
96
|
-
not_if {
|
97
|
-
File.exists?("#{node[:travis][:worker][:home]}/boxes/travis-#{node[:travis][:worker][:env]}.box")
|
98
|
-
}
|
99
97
|
notifies :restart, resources(:service => 'travis-worker')
|
100
98
|
environment({"HOME" => home})
|
101
99
|
end
|
102
100
|
|
101
|
+
bash "copy box image" do
|
102
|
+
code "cp #{node[:travis][:worker][:home]}/boxes/travis-#{node[:travis][:worker][:env]}-pro.box #{node[:travis][:worker][:home]}/boxes/travis-#{node[:travis][:worker][:env]}.box"
|
103
|
+
user "travis"
|
104
|
+
group "travis"
|
105
|
+
cwd node[:travis][:worker][:home]
|
106
|
+
not_if {
|
107
|
+
File.exists?("#{node[:travis][:worker][:home]}/boxes/travis-#{node[:travis][:worker][:env]}.box")
|
108
|
+
}
|
109
|
+
only_if {
|
110
|
+
File.exists?("#{node[:travis][:worker][:home]}/boxes/travis-#{node[:travis][:worker][:env]}-pro.box")
|
111
|
+
}
|
112
|
+
end
|
103
113
|
|
104
114
|
bash "create VirtualBox images" do
|
105
115
|
code "#{node[:jruby][:bin]} ./bin/thor travis:vms:create &>/tmp/vbox-create.log"
|
data/chef/travis-cookbooks/worker_host/travis_worker/templates/default/sv-travis-worker-run.erb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
exec 2>&1
|
3
3
|
cd <%= @options[:worker_home] %>
|
4
|
-
exec chpst -u <%= @options[:user] %>:<%= @options[:group] %> <%= @options[:jruby] %> ./bin/thor travis:worker:boot
|
4
|
+
exec chpst -u <%= @options[:user] %>:<%= @options[:group] %> /usr/local/bin/signal_wrapper <%= @options[:jruby] %> ./bin/thor travis:worker:boot
|
@@ -0,0 +1,21 @@
|
|
1
|
+
env: <%= @worker[:env] %>
|
2
|
+
linux:
|
3
|
+
host: <%= @hostname %>
|
4
|
+
log_level: <%= @worker[:log_level] %>
|
5
|
+
amqp:
|
6
|
+
<% @amqp.each do |key, value| -%>
|
7
|
+
<%= key %>: <%= value %>
|
8
|
+
<% end -%>
|
9
|
+
vms:
|
10
|
+
provider: <%= @worker[:provider] %>
|
11
|
+
count: <%= @worker[:vms] %>
|
12
|
+
blue_box:
|
13
|
+
customer_id: <%= @bluebox[:customer_id] %>
|
14
|
+
api_key: <%= @bluebox[:api_key] %>
|
15
|
+
flavor_id: <%= @bluebox[:flavor_id] %>
|
16
|
+
location_id: <%= @bluebox[:location_id] %>
|
17
|
+
librato:
|
18
|
+
email: <%= @librato[:email] %>
|
19
|
+
token: <%= @librato[:token] %>
|
20
|
+
language_mappings:
|
21
|
+
haskell: jvm
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_recipe 'collectd'
|
2
|
+
|
3
|
+
collectd_plugin "load"
|
4
|
+
|
5
|
+
collectd_plugin "memory"
|
6
|
+
|
7
|
+
collectd_plugin "interface" do
|
8
|
+
options :interface => "lo", :ignore_selected => true
|
9
|
+
end
|
10
|
+
|
11
|
+
collectd_plugin "df" do
|
12
|
+
options :mount_point => "/",
|
13
|
+
:report_reserved => false,
|
14
|
+
:report_inodes => false
|
15
|
+
end
|
@@ -42,6 +42,11 @@ users.each do |user|
|
|
42
42
|
notifies :reload, resources(:ohai => "reload_passwd"), :immediately
|
43
43
|
end
|
44
44
|
|
45
|
+
file "#{user[:home]}/.zshrc" do
|
46
|
+
action :create_if_missing
|
47
|
+
content "# Automatically generated by Chef."
|
48
|
+
end
|
49
|
+
|
45
50
|
(user[:groups] || []).each do |group_name|
|
46
51
|
group_id = groups.find {|group| group[:id] == group_name}[:gid]
|
47
52
|
|
data/cookbooks/.gitkeep
ADDED
data/lib/lobot.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
require "lobot/version"
|
2
|
+
require "lobot/config"
|
3
|
+
require "lobot/sobo"
|
4
|
+
require "lobot/amazon"
|
5
|
+
require "lobot/keychain"
|
6
|
+
require "lobot/configuration_wizard"
|
7
|
+
require "lobot/cli"
|
8
|
+
require "lobot/password"
|
data/lib/lobot/amazon.rb
CHANGED
@@ -11,15 +11,15 @@ module Lobot
|
|
11
11
|
@secret = secret
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def fog_security_groups
|
15
15
|
fog.security_groups
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
18
|
+
def fog_key_pairs
|
19
19
|
fog.key_pairs
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
22
|
+
def fog_servers
|
23
23
|
fog.servers
|
24
24
|
end
|
25
25
|
|
@@ -28,13 +28,13 @@ module Lobot
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def create_security_group(group_name)
|
31
|
-
unless
|
32
|
-
|
31
|
+
unless fog_security_groups.get(group_name)
|
32
|
+
fog_security_groups.create(:name => group_name, :description => 'Lobot-generated group')
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
def open_port(group_name, *ports)
|
37
|
-
group =
|
37
|
+
group = fog_security_groups.get(group_name)
|
38
38
|
ports.each do |port|
|
39
39
|
unless group.ip_permissions.any? { |p| (p["fromPort"]..p["toPort"]).include?(port) }
|
40
40
|
group.authorize_port_range(port..port)
|
@@ -43,20 +43,26 @@ module Lobot
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def delete_key_pair(key_pair_name)
|
46
|
-
|
46
|
+
fog_key_pairs.new(:name => key_pair_name).destroy
|
47
47
|
end
|
48
48
|
|
49
|
-
def add_key_pair(key_pair_name,
|
50
|
-
unless
|
51
|
-
|
52
|
-
|
49
|
+
def add_key_pair(key_pair_name, public_key)
|
50
|
+
fog_key_pairs.create(:name => key_pair_name, :public_key => public_key) unless fog_key_pairs.get(key_pair_name)
|
51
|
+
end
|
52
|
+
|
53
|
+
def with_key_pair(pubkey)
|
54
|
+
unique_key_pair_name = "LOBOT-#{Time.now.to_i}"
|
55
|
+
add_key_pair(unique_key_pair_name, pubkey)
|
56
|
+
yield unique_key_pair_name if block_given?
|
57
|
+
ensure
|
58
|
+
delete_key_pair(unique_key_pair_name)
|
53
59
|
end
|
54
60
|
|
55
61
|
def launch_server(key_pair_name, security_group_name, instance_type = "m1.medium")
|
56
|
-
|
62
|
+
fog_servers.create(
|
57
63
|
:image_id => "ami-a29943cb",
|
58
64
|
:flavor_id => instance_type,
|
59
|
-
:availability_zone => "us-east-
|
65
|
+
:availability_zone => "us-east-1b",
|
60
66
|
:tags => {"Name" => "Lobot", "lobot" => Lobot::VERSION},
|
61
67
|
:key_name => key_pair_name,
|
62
68
|
:groups => [security_group_name]
|
@@ -67,11 +73,19 @@ module Lobot
|
|
67
73
|
end
|
68
74
|
end
|
69
75
|
|
70
|
-
def destroy_ec2
|
71
|
-
servers
|
72
|
-
|
73
|
-
|
74
|
-
|
76
|
+
def destroy_ec2(confirm_proc, *args)
|
77
|
+
servers.each do |server|
|
78
|
+
next unless (args == [:all]) || args.include?(server.id)
|
79
|
+
next unless confirm_proc.call(server)
|
80
|
+
ip = server.public_ip_address
|
81
|
+
server.destroy
|
82
|
+
release_elastic_ip(ip)
|
83
|
+
yield(server) if block_given?
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def servers
|
88
|
+
fog_servers.select { |s| s.tags.keys.include?("lobot") && s.state == "running" }
|
75
89
|
end
|
76
90
|
|
77
91
|
def release_elastic_ip(ip)
|
@@ -88,4 +102,4 @@ module Lobot
|
|
88
102
|
)
|
89
103
|
end
|
90
104
|
end
|
91
|
-
end
|
105
|
+
end
|
data/lib/lobot/cli.rb
CHANGED
@@ -1,50 +1,55 @@
|
|
1
1
|
require "thor"
|
2
|
-
require "
|
3
|
-
require "lobot/sobo"
|
4
|
-
require "lobot/amazon"
|
5
|
-
require "lobot/jenkins"
|
2
|
+
require "thor/group"
|
6
3
|
require "pp"
|
7
4
|
require "tempfile"
|
8
5
|
require "json"
|
6
|
+
require "lobot/configuration_wizard"
|
7
|
+
require "godot"
|
9
8
|
|
10
9
|
module Lobot
|
11
|
-
class CLI < Thor
|
10
|
+
class CLI < ::Thor
|
11
|
+
register(ConfigurationWizard, "setup", "setup", ConfigurationWizard::DESCRIPTION_TEXT)
|
12
|
+
|
12
13
|
desc "ssh", "SSH into Lobot"
|
13
14
|
def ssh
|
14
|
-
exec("ssh -i #{lobot_config.
|
15
|
+
exec("ssh -i #{lobot_config.server_ssh_key_path} ubuntu@#{lobot_config.master} -p #{lobot_config.ssh_port}")
|
15
16
|
end
|
16
17
|
|
17
18
|
desc "open", "Open a browser to Lobot"
|
18
19
|
def open
|
19
|
-
exec("open
|
20
|
+
exec("open #{lobot_config.jenkins_url}/")
|
20
21
|
end
|
21
22
|
|
22
23
|
desc "create", "Create a new Lobot server using EC2"
|
23
24
|
def create
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
server
|
25
|
+
server = amazon.with_key_pair(lobot_config.server_ssh_pubkey) do |keypair_name|
|
26
|
+
amazon.create_security_group("lobot")
|
27
|
+
amazon.open_port("lobot", 22, 443)
|
28
|
+
amazon.launch_server(keypair_name, "lobot", lobot_config.instance_size)
|
29
|
+
end
|
30
|
+
wait_for_server(server)
|
30
31
|
|
31
|
-
|
32
|
-
lobot_config.master = server.public_ip_address
|
33
|
-
lobot_config.instance_id = server.id
|
34
|
-
lobot_config.save
|
32
|
+
say("Writing ip address for ec2: #{server.public_ip_address}")
|
35
33
|
|
36
|
-
|
34
|
+
lobot_config.update(master: server.public_ip_address, instance_id: server.id)
|
37
35
|
end
|
38
36
|
|
39
|
-
desc "destroy_ec2", "Destroys all the lobot resources
|
37
|
+
desc "destroy_ec2", "Destroys all the lobot resources on EC2"
|
38
|
+
method_option :all, default: false
|
39
|
+
method_option :force, default: false
|
40
40
|
def destroy_ec2
|
41
|
-
|
42
|
-
|
41
|
+
instance = (options['all'] ? :all : lobot_config.instance_id)
|
42
|
+
|
43
|
+
amazon.destroy_ec2(confirmation_proc(options['force']), instance) do |server|
|
44
|
+
say("Clearing ip address for ec2: #{server.public_ip_address}")
|
45
|
+
|
46
|
+
lobot_config.update(master: nil, instance_id: nil)
|
47
|
+
end
|
43
48
|
end
|
44
49
|
|
45
|
-
desc "create_vagrant", "
|
50
|
+
desc "create_vagrant", "Creates a vagrant instance"
|
46
51
|
def create_vagrant
|
47
|
-
spawn_env = {"LOBOT_SSH_KEY" =>
|
52
|
+
spawn_env = {"LOBOT_SSH_KEY" => lobot_config.server_ssh_pubkey_path,
|
48
53
|
"VAGRANT_HOME" => File.expand_path("~")}
|
49
54
|
spawn_options = {chdir: lobot_root_path}
|
50
55
|
|
@@ -53,22 +58,25 @@ module Lobot
|
|
53
58
|
|
54
59
|
vagrant_ip = "192.168.33.10"
|
55
60
|
|
56
|
-
|
57
|
-
lobot_config.master = vagrant_ip
|
58
|
-
lobot_config.save
|
61
|
+
say("Writing ip address for vagrant: #{vagrant_ip}")
|
59
62
|
|
60
|
-
|
63
|
+
lobot_config.update(master: vagrant_ip)
|
61
64
|
end
|
62
65
|
|
63
66
|
desc "config", "Dumps all configuration data for Lobot"
|
64
67
|
def config
|
65
|
-
|
68
|
+
say lobot_config.display
|
69
|
+
end
|
70
|
+
|
71
|
+
desc "certificate", "Dump the certificate"
|
72
|
+
def certificate
|
73
|
+
say(keychain.fetch_remote_certificate("https://#{lobot_config.master}"))
|
66
74
|
end
|
67
75
|
|
68
76
|
desc "bootstrap", "Configures Lobot's master node"
|
69
77
|
def bootstrap
|
70
78
|
sync_bootstrap_script
|
71
|
-
master_server.
|
79
|
+
master_server.system!("bash -l script/bootstrap_server.sh")
|
72
80
|
rescue Errno::ECONNRESET
|
73
81
|
sleep 1
|
74
82
|
end
|
@@ -78,28 +86,28 @@ module Lobot
|
|
78
86
|
sync_chef_recipes
|
79
87
|
upload_soloist
|
80
88
|
sync_github_ssh_key
|
81
|
-
master_server.
|
82
|
-
rescue Errno::ECONNRESET
|
89
|
+
master_server.upload(File.expand_path('../../../templates/Gemfile-remote', __FILE__), 'Gemfile')
|
90
|
+
master_server.system!("bash -l -c 'rvm use 1.9.3; bundle install; soloist'") rescue Errno::ECONNRESET
|
83
91
|
sleep 1
|
84
92
|
end
|
85
93
|
|
86
|
-
desc "add_build
|
94
|
+
desc "add_build <name> <repository> <branch> <command>", "Adds a build to Lobot"
|
87
95
|
def add_build(name, repository, branch, command)
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
"branch" => branch,
|
92
|
-
"command" => command
|
93
|
-
}
|
94
|
-
lobot_config.node_attributes = lobot_config.node_attributes.tap do |config|
|
95
|
-
config.jenkins.builds << build unless config.jenkins.builds.include?(build)
|
96
|
-
end
|
96
|
+
raise lobot_config.errors.join(" and ") unless lobot_config.valid?
|
97
|
+
|
98
|
+
lobot_config.add_build(name, repository, branch, command)
|
97
99
|
lobot_config.save
|
98
100
|
end
|
99
101
|
|
102
|
+
desc "trust_certificate", "Adds the current master's certificate to your OSX keychain"
|
103
|
+
def trust_certificate
|
104
|
+
certificate_contents = keychain.fetch_remote_certificate("https://#{lobot_config.master}/")
|
105
|
+
keychain.add_certificate(certificate_contents)
|
106
|
+
end
|
107
|
+
|
100
108
|
no_tasks do
|
101
109
|
def master_server
|
102
|
-
@master_server ||= Lobot::Sobo.new(lobot_config.master, lobot_config.
|
110
|
+
@master_server ||= Lobot::Sobo.new(lobot_config.master, lobot_config.server_ssh_key_path)
|
103
111
|
end
|
104
112
|
|
105
113
|
def lobot_config
|
@@ -110,16 +118,21 @@ module Lobot
|
|
110
118
|
@amazon ||= Lobot::Amazon.new(lobot_config.aws_key, lobot_config.aws_secret)
|
111
119
|
end
|
112
120
|
|
121
|
+
def keychain
|
122
|
+
@keychain ||= Lobot::Keychain.new("/Library/Keychains/System.keychain")
|
123
|
+
end
|
124
|
+
|
113
125
|
def sync_bootstrap_script
|
114
126
|
master_server.upload(File.join(lobot_root_path, "script/"), "script/")
|
115
127
|
end
|
116
128
|
|
117
129
|
def sync_github_ssh_key
|
118
|
-
master_server.upload(lobot_config.
|
130
|
+
master_server.upload(lobot_config.github_ssh_key_path, "~/.ssh/id_rsa")
|
119
131
|
end
|
120
132
|
|
121
133
|
def sync_chef_recipes
|
122
134
|
master_server.upload(File.join(lobot_root_path, "chef/"), "chef/")
|
135
|
+
master_server.upload("cookbooks/", "chef/project-cookbooks/")
|
123
136
|
end
|
124
137
|
|
125
138
|
def upload_soloist
|
@@ -132,6 +145,7 @@ module Lobot
|
|
132
145
|
end
|
133
146
|
|
134
147
|
private
|
148
|
+
|
135
149
|
def lobot_root_path
|
136
150
|
File.expand_path('../../..', __FILE__)
|
137
151
|
end
|
@@ -140,9 +154,19 @@ module Lobot
|
|
140
154
|
File.expand_path("config/lobot.yml", Dir.pwd)
|
141
155
|
end
|
142
156
|
|
143
|
-
def
|
144
|
-
|
145
|
-
|
157
|
+
def wait_for_server(server)
|
158
|
+
Godot.new(server.public_ip_address, 22, :timeout => 180).wait!
|
159
|
+
end
|
160
|
+
|
161
|
+
# The proc is given a Fog server object and must return true/false
|
162
|
+
def confirmation_proc(force)
|
163
|
+
if force
|
164
|
+
->(_) { true }
|
165
|
+
else
|
166
|
+
->(server) {
|
167
|
+
yes?("DESTROY #{server.id} (#{server.public_ip_address})?")
|
168
|
+
}
|
169
|
+
end
|
146
170
|
end
|
147
171
|
end
|
148
172
|
end
|