Commit 6ad4fc6c authored by jz143's avatar jz143

automated deployment (untested; committing in case of fire or SSD failure)

parent a46dece1
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
# https://github.com/capistrano/passenger
#
require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
......@@ -32,7 +32,12 @@ gem 'sdoc', '~> 0.4.0', group: :doc
# gem 'unicorn'
# Use Capistrano for deployment
gem 'capistrano-rails', '~> 1.1', group: :development
group :development do
gem 'capistrano-rvm'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-passenger', '~> 0.1.1'
end
# Use database for session store
gem 'activerecord-session_store'
......
......@@ -65,9 +65,14 @@ GEM
capistrano-bundler (1.1.4)
capistrano (~> 3.1)
sshkit (~> 1.2)
capistrano-passenger (0.1.1)
capistrano (~> 3.0)
capistrano-rails (1.1.5)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.7)
......@@ -203,7 +208,10 @@ DEPENDENCIES
activerecord-session_store
bootstrap-sass (~> 3.3.5)
byebug
capistrano-bundler (~> 1.1.2)
capistrano-passenger (~> 0.1.1)
capistrano-rails (~> 1.1)
capistrano-rvm
coffee-rails (~> 4.1.0)
config (~> 1.0.0)
jbuilder (~> 2.0)
......
# config valid only for current version of Capistrano
lock '3.4.0'
set :application, 'appstore'
set :repo_url, 'git@gitlab.oit.duke.edu:colab/appstore.git'
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app_name
set :deploy_to, '/Users/appstore/appstore'
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
# set :pty, true
# Default value for :linked_files is []
set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
# Default value for linked_dirs is []
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
namespace :deploy do
desc 'Upload secret configuration files'
task :upload_config do
on roles(:app, :ios_sign), in: :sequence do
execute :mkdir, '-p', "#{shared_path}/config"
upload! 'config/database.yml', "#{shared_path}/config/database.yml"
upload! 'config/secrets.yml', "#{shared_path}/config/secrets.yml"
end
end
before 'deploy:check:linked_dirs', :upload_config
end
role :app, %w{appstore@istudio-osxserver.oit.duke.edu}
role :web, %w{appstore@istudio-osxserver.oit.duke.edu}
role :db, %w{appstore@istudio-osxserver.oit.duke.edu}
# server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
# role-based syntax
# ==================
# Defines a role with one or multiple servers. The primary server in each
# group is considered to be the first unless any hosts have the primary
# property set. Specify the username and a domain or IP for the server.
# Don't use `:all`, it's a meta role.
# role :app, %w{deploy@example.com}, my_property: :my_value
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
# role :db, %w{deploy@example.com}
# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
# These variables are then only loaded and set in this stage.
# For available Capistrano configuration variables see the documentation page.
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult the Net::SSH documentation.
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
#
# Global options
# --------------
# set :ssh_options, {
# keys: %w(/home/rlisowski/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
#
# The server-based syntax can be used to override options:
# ------------------------------------
# server 'example.com',
# user: 'user_name',
# roles: %w{web app},
# ssh_options: {
# user: 'user_name', # overrides user setting above
# keys: %w(/home/user_name/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(publickey password)
# # password: 'please use keys'
# }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment