From 5237db4984d2c6fdd2ed675589ae3c187ba01d4a Mon Sep 17 00:00:00 2001 From: Bill Cromie Date: Fri, 5 Feb 2016 16:44:29 -0500 Subject: [PATCH] adding a staging deploy! --- .travis.yml | 14 +++++++++++--- Gemfile | 3 +++ Gemfile.lock | 34 ++++++++++++++++++++++++++++++++++ config/deploy.rb | 6 ++++-- config/deploy/staging.rb | 1 - deploy_key.enc | Bin 0 -> 1680 bytes 6 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 deploy_key.enc diff --git a/.travis.yml b/.travis.yml index 0e3ec194e..018d58714 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,16 @@ language: ruby sudo: required -bundler_args: --jobs=3 --retry=3 +bundler_args: "--jobs=4 --retry=3" cache: bundler services: - - elasticsearch +- elasticsearch before_script: - - sleep 10 \ No newline at end of file +- sleep 10 +after_success: +- chmod 600 deploy-key +- mv deploy-key ~/.ssh/id_rsa +- cap deploy staging +before_install: +- openssl aes-256-cbc -K $encrypted_bde597b39305_key -iv $encrypted_bde597b39305_iv + -in deploy_key.enc -out deploy_key -d +- echo -e "Host example.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config diff --git a/Gemfile b/Gemfile index a10b55117..2251dea34 100644 --- a/Gemfile +++ b/Gemfile @@ -34,6 +34,9 @@ group :development do # silences logging of requests for assets gem 'quiet_assets' + + # enabling us to deploy via travis and encrypted keys! + gem 'travis' end group :production do diff --git a/Gemfile.lock b/Gemfile.lock index 344d81744..c5bab3bdd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -55,6 +55,7 @@ GEM ansi (1.5.0) arel (6.0.3) ast (2.2.0) + backports (3.6.7) bcrypt (3.1.10) builder (3.2.2) bullet (5.0.0) @@ -94,6 +95,8 @@ GEM domain_name (0.5.25) unf (>= 0.0.5, < 1.0.0) erubis (2.7.0) + ethon (0.8.1) + ffi (>= 1.3.0) execjs (2.6.0) factory_girl (4.5.0) activesupport (>= 3.0.0) @@ -102,6 +105,10 @@ GEM railties (>= 3.0.0) faker (1.6.1) i18n (~> 0.5) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.10.0) + faraday (>= 0.7.4, < 0.10) fast_stack (0.1.0) rake rake-compiler @@ -109,6 +116,13 @@ GEM flamegraph (0.1.0) fast_stack formatador (0.2.5) + gh (0.14.0) + addressable + backports + faraday (~> 0.8) + multi_json (~> 1.0) + net-http-persistent (>= 2.7) + net-http-pipeline gibbon (0.4.6) httparty multi_json (>= 1.3.4) @@ -160,6 +174,8 @@ GEM json (1.8.3) jwt (1.5.2) kgio (2.10.0) + launchy (2.4.3) + addressable (~> 2.3) listen (3.0.5) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) @@ -184,6 +200,8 @@ GEM multipart-post (2.0.0) mysql2 (0.3.20) nenv (0.2.0) + net-http-persistent (2.9.4) + net-http-pipeline (1.0.1) net-scp (1.2.1) net-ssh (>= 2.6.5) net-sftp (2.1.2) @@ -212,6 +230,9 @@ GEM slop (~> 3.4) pry-rails (0.3.4) pry (>= 0.9.10) + pusher-client (0.6.2) + json + websocket (~> 1.0) quiet_assets (1.1.0) railties (>= 3.1, < 5.0) rack (1.6.4) @@ -318,6 +339,15 @@ GEM multi_json (~> 1.3) rake rest-client (~> 1.6) + travis (1.8.2) + backports + faraday (~> 0.9) + faraday_middleware (~> 0.9, >= 0.9.1) + gh (~> 0.13) + highline (~> 1.6) + launchy (~> 2.1) + pusher-client (~> 0.4) + typhoeus (~> 0.6, >= 0.6.8) turbolinks (2.5.3) coffee-rails twilio-ruby (4.9.0) @@ -329,6 +359,8 @@ GEM execjs rails (>= 3.1) railties (>= 3.1) + typhoeus (0.8.0) + ethon (>= 0.8.0) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.2) @@ -348,6 +380,7 @@ GEM activemodel (>= 4.2) debug_inspector railties (>= 4.2) + websocket (1.2.2) will_paginate (3.1.0) will_paginate-bootstrap (1.0.1) will_paginate (>= 3.0.3) @@ -405,6 +438,7 @@ DEPENDENCIES sqlite3 stackprof tire + travis turbolinks twilio-ruby twitter-bootstrap-rails (~> 2.2.0) diff --git a/config/deploy.rb b/config/deploy.rb index c3c88ad8b..e8baec062 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -4,9 +4,11 @@ require 'rvm/capistrano/gem_install_uninstall' #loading environment variables so we can all use the same deployment -YAML.load(File.open('local_env.yml')).each do |key, value| +YAML.load(File.open(File.dirname(__FILE__) + '/local_env.yml')).each do |key, value| ENV[key.to_s] = value -end if File.exist?(env_file) + puts ENV[key.to_s] +end if File.exist?(File.dirname(__FILE__) + '/local_env.yml') + set :repository, ENV['GIT_REPOSITORY'] diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb index 725b4f759..9205697ee 100644 --- a/config/deploy/staging.rb +++ b/config/deploy/staging.rb @@ -3,7 +3,6 @@ set :rails_env, :staging set :rvm_ruby_string, '2.2.4@staging' # use the same ruby as used locally for deployment - server ENV['STAGING_SERVER'], :app, :web, :db, primary: true task :link_env_var do diff --git a/deploy_key.enc b/deploy_key.enc new file mode 100644 index 0000000000000000000000000000000000000000..c60ab881693a5264937f53df792cb9f59dc71d8d GIT binary patch literal 1680 zcmV;B25#;H$n|hbezR z7YBr%v@LgZN6X@jew3+?M4StfcahxmIsQ6S7zv8Zk_^Y9;<+6<4@r(-&jP`>aV%ew zEx`~sUMxRq#GRWJMA>(z{zXG90?%Yp3pA$wv=d#Si5a7W>|fr6n1&xDaKXLfj2i<3wP2nvoypx7+GU2_ZUt*cHG57g zA3!~1&BT-pS^g|J+W?Q{HKT+nG0Q645?nV*0-~|639G=Xsyt+)QRE+|mU+&}@}cY} zBKEV@Z;rarS0fcd^JOHaN<*#wIU4Eq+YTR7{kgEA`x{NGS&0NXA;7J=B(iP^z6DL+JBGJl zu1|fP0S86-^8p`D(&9Lmmh=MAm~e8>0p4fO&s^_p79cr2q?230OUSlez6F z;pky($J9G?3oy2RIOlLUw<2Go^4}1q=V=yzg<|PJu?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