Skip to content

Commit

Permalink
adding a staging deploy!
Browse files Browse the repository at this point in the history
  • Loading branch information
cromulus committed Feb 5, 2016
1 parent 4c5fd2f commit 5237db4
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 6 deletions.
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
- 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
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -102,13 +105,24 @@ 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
ffi (1.9.10)
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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -405,6 +438,7 @@ DEPENDENCIES
sqlite3
stackprof
tire
travis
turbolinks
twilio-ruby
twitter-bootstrap-rails (~> 2.2.0)
Expand Down
6 changes: 4 additions & 2 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down
1 change: 0 additions & 1 deletion config/deploy/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added deploy_key.enc
Binary file not shown.

0 comments on commit 5237db4

Please sign in to comment.