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 000000000..c60ab8816 Binary files /dev/null and b/deploy_key.enc differ