adds capistrano's deploy configuration and scripts
This commit is contained in:
12
Capfile
Normal file
12
Capfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Load DSL and set up stages
|
||||||
|
require 'capistrano/setup'
|
||||||
|
|
||||||
|
# Include default deployment tasks
|
||||||
|
require 'capistrano/deploy'
|
||||||
|
|
||||||
|
require 'capistrano/bundler'
|
||||||
|
require 'capistrano/rails/assets'
|
||||||
|
require 'capistrano/rails/migrations'
|
||||||
|
|
||||||
|
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
|
||||||
|
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
|
||||||
9
Gemfile
9
Gemfile
@@ -1,6 +1,5 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
|
||||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||||
gem 'rails', '4.2.3'
|
gem 'rails', '4.2.3'
|
||||||
# Use PostgreSQL
|
# Use PostgreSQL
|
||||||
@@ -26,11 +25,6 @@ gem 'devise'
|
|||||||
# Use ActiveModel has_secure_password
|
# Use ActiveModel has_secure_password
|
||||||
# gem 'bcrypt', '~> 3.1.7'
|
# gem 'bcrypt', '~> 3.1.7'
|
||||||
gem 'acts_as_commentable_with_threading'
|
gem 'acts_as_commentable_with_threading'
|
||||||
# Use Unicorn as the app server
|
|
||||||
# gem 'unicorn'
|
|
||||||
|
|
||||||
# Use Capistrano for deployment
|
|
||||||
# gem 'capistrano-rails', group: :development
|
|
||||||
gem 'acts-as-taggable-on'
|
gem 'acts-as-taggable-on'
|
||||||
gem "responders"
|
gem "responders"
|
||||||
gem 'foundation-rails'
|
gem 'foundation-rails'
|
||||||
@@ -52,6 +46,9 @@ group :development, :test do
|
|||||||
gem 'quiet_assets'
|
gem 'quiet_assets'
|
||||||
gem 'letter_opener_web', '~> 1.2.0'
|
gem 'letter_opener_web', '~> 1.2.0'
|
||||||
gem 'i18n-tasks'
|
gem 'i18n-tasks'
|
||||||
|
gem 'capistrano', '3.4.0', require: false
|
||||||
|
gem "capistrano-bundler", '1.1.4', require: false
|
||||||
|
gem "capistrano-rails", '1.1.3', require: false
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
|
|||||||
21
Gemfile.lock
21
Gemfile.lock
@@ -53,6 +53,16 @@ GEM
|
|||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
byebug (5.0.0)
|
byebug (5.0.0)
|
||||||
columnize (= 0.9.0)
|
columnize (= 0.9.0)
|
||||||
|
capistrano (3.4.0)
|
||||||
|
i18n
|
||||||
|
rake (>= 10.0.0)
|
||||||
|
sshkit (~> 1.3)
|
||||||
|
capistrano-bundler (1.1.4)
|
||||||
|
capistrano (~> 3.1)
|
||||||
|
sshkit (~> 1.2)
|
||||||
|
capistrano-rails (1.1.3)
|
||||||
|
capistrano (~> 3.1)
|
||||||
|
capistrano-bundler (~> 1.1)
|
||||||
capybara (2.4.4)
|
capybara (2.4.4)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
@@ -74,6 +84,7 @@ GEM
|
|||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.9.1.1)
|
coffee-script-source (1.9.1.1)
|
||||||
|
colorize (0.7.7)
|
||||||
columnize (0.9.0)
|
columnize (0.9.0)
|
||||||
coveralls (0.8.2)
|
coveralls (0.8.2)
|
||||||
json (~> 1.8)
|
json (~> 1.8)
|
||||||
@@ -145,6 +156,9 @@ GEM
|
|||||||
mini_portile (0.6.2)
|
mini_portile (0.6.2)
|
||||||
minitest (5.7.0)
|
minitest (5.7.0)
|
||||||
multi_json (1.11.2)
|
multi_json (1.11.2)
|
||||||
|
net-scp (1.2.1)
|
||||||
|
net-ssh (>= 2.6.5)
|
||||||
|
net-ssh (2.9.2)
|
||||||
netrc (0.10.3)
|
netrc (0.10.3)
|
||||||
nokogiri (1.6.6.2)
|
nokogiri (1.6.6.2)
|
||||||
mini_portile (~> 0.6.0)
|
mini_portile (~> 0.6.0)
|
||||||
@@ -232,6 +246,10 @@ GEM
|
|||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
|
sshkit (1.7.1)
|
||||||
|
colorize (>= 0.7.0)
|
||||||
|
net-scp (>= 1.1.2)
|
||||||
|
net-ssh (>= 2.8.0)
|
||||||
term-ansicolor (1.3.2)
|
term-ansicolor (1.3.2)
|
||||||
tins (~> 1.0)
|
tins (~> 1.0)
|
||||||
terminal-table (1.5.2)
|
terminal-table (1.5.2)
|
||||||
@@ -271,6 +289,9 @@ DEPENDENCIES
|
|||||||
acts_as_commentable_with_threading
|
acts_as_commentable_with_threading
|
||||||
acts_as_votable
|
acts_as_votable
|
||||||
byebug
|
byebug
|
||||||
|
capistrano (= 3.4.0)
|
||||||
|
capistrano-bundler (= 1.1.4)
|
||||||
|
capistrano-rails (= 1.1.3)
|
||||||
capybara
|
capybara
|
||||||
ckeditor
|
ckeditor
|
||||||
coffee-rails (~> 4.1.0)
|
coffee-rails (~> 4.1.0)
|
||||||
|
|||||||
37
config/deploy.rb
Normal file
37
config/deploy.rb
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# config valid only for current version of Capistrano
|
||||||
|
lock '3.4.0'
|
||||||
|
|
||||||
|
def deploysecret(key)
|
||||||
|
@deploy_secrets_yml ||= YAML.load_file('config/deploy-secrets.yml')[fetch(:stage).to_s]
|
||||||
|
@deploy_secrets_yml[key.to_s]
|
||||||
|
end
|
||||||
|
|
||||||
|
set :rails_env, fetch(:stage)
|
||||||
|
|
||||||
|
set :application, 'participacion'
|
||||||
|
set :repo_url, 'git@github.com:AyuntamientoMadrid/participacion.git'
|
||||||
|
|
||||||
|
set :scm, :git
|
||||||
|
set :revision, `git rev-parse --short #{fetch(:branch)}`.strip
|
||||||
|
|
||||||
|
set :log_level, :info
|
||||||
|
|
||||||
|
set :linked_files, %w{config/database.yml config/secrets.yml}
|
||||||
|
set :linked_dirs, %w{log tmp public/system public/assets}
|
||||||
|
|
||||||
|
set :keep_releases, 5
|
||||||
|
|
||||||
|
set :local_user, ENV['USER']
|
||||||
|
|
||||||
|
namespace :deploy do
|
||||||
|
|
||||||
|
after :restart, :clear_cache do
|
||||||
|
on roles(:web), in: :groups, limit: 3, wait: 10 do
|
||||||
|
# Here we can do anything such as:
|
||||||
|
# within release_path do
|
||||||
|
# execute :rake, 'cache:clear'
|
||||||
|
# end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
5
config/deploy/preproduction.rb
Normal file
5
config/deploy/preproduction.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
set :deploy_to, deploysecret(:deploy_to)
|
||||||
|
set :branch, :production
|
||||||
|
set :ssh_options, port: deploysecret(:ssh_port)
|
||||||
|
|
||||||
|
server deploysecret(:server), user: deploysecret(:user), roles: %w(web app db importer)
|
||||||
5
config/deploy/production.rb
Normal file
5
config/deploy/production.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
set :deploy_to, deploysecret(:deploy_to)
|
||||||
|
set :branch, :production
|
||||||
|
set :ssh_options, port: deploysecret(:ssh_port)
|
||||||
|
|
||||||
|
server deploysecret(:server), user: deploysecret(:user), roles: %w(web app db importer)
|
||||||
5
config/deploy/staging.rb
Normal file
5
config/deploy/staging.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
set :deploy_to, deploysecret(:deploy_to)
|
||||||
|
set :branch, :master
|
||||||
|
set :ssh_options, port: deploysecret(:ssh_port)
|
||||||
|
|
||||||
|
server deploysecret(:server), user: deploysecret(:user), roles: %w(web app db importer)
|
||||||
Reference in New Issue
Block a user