Skip to content
This repository has been archived by the owner on Mar 5, 2019. It is now read-only.

Capistrano subdir configuration #155

Open
wants to merge 7 commits into
base: capistrano_subdir_configuration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ruby/meetings/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.3.1
ruby-2.4.0
2 changes: 1 addition & 1 deletion src/ruby/meetings/Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ require 'rvm1/capistrano3'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/rails/migrations'

require 'capistrano/passenger'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
69 changes: 26 additions & 43 deletions src/ruby/meetings/Gemfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
# Avoid warnings about the git protocol being insecure when using github repos.
# https://github.com/bundler/bundler/issues/4978
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end

source 'https://rubygems.org'
#https://github.com/twbs/bootstrap-rubygem
source 'https://rubygems.org'
source 'https://rails-assets.org' do
gem 'rails-assets-tether', '>= 1.1.0'
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use postgresql as the database for Active Record
Expand Down Expand Up @@ -41,52 +34,53 @@ gem 'jbuilder', '~> 2.5'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'unicorn'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end

group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "passenger", ">= 5.0.25", require: "phusion_passenger/rack_handler"
gem 'draper', "3.0.0.pre1"

gem 'bootstrap', '~> 4.0.0.alpha4'
gem 'carrierwave'
gem 'mini_magick'
gem 'draper', github: 'drapergem/draper'
gem 'haml-rails'
gem 'country_select'
gem 'kaminari'
gem "htmlentities"
gem 'factory_girl_rails'
gem 'active_model_serializers', '~> 0.10.0'
gem 'activemodel-serializers-xml'
gem 'swagger-blocks'
gem 'jsonapi-resources'
gem 'globalize', github: 'JohnSmall/globalize'
gem 'rack-cors', :require => 'rack/cors'

group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'capistrano', '~> 3.6'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-passenger'
gem 'railroady'
gem 'rvm1-capistrano3', require: false
gem 'git'
gem 'spring-commands-rspec'
gem 'spring-commands-cucumber'
#gem 'capistrano-git-submodule-strategy', '~> 0.1', :github => 'ekho/capistrano-git-submodule-strategy'
end

group :development, :test do
gem 'byebug', platform: :mri
gem 'mailcatcher'
gem 'syntax'
gem 'rspec-rails'
gem 'rspec-activemodel-mocks'
gem 'cucumber-rails', require: false
gem 'awesome_print'
gem 'webmock'
gem 'capistrano-git-submodule-strategy', '~> 0.1', github: 'ekho/capistrano-git-submodule-strategy'
gem 'faraday'
gem 'jsonpath'
gem 'factory_girl_rails'
end

group :test do
Expand All @@ -102,14 +96,3 @@ group :test do
gem 'rails-controller-testing'
end

group :development do
gem 'capistrano', '~> 3.6'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-passenger'
gem 'railroady'
gem 'rvm1-capistrano3', require: false
gem 'git'
gem 'spring-commands-rspec'
gem 'spring-commands-cucumber'
end
57 changes: 12 additions & 45 deletions src/ruby/meetings/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
GIT
remote: https://github.com/JohnSmall/globalize.git
revision: 7d507472e4076c720d798736137eb28d169eb1a1
specs:
globalize (5.1.0)
activemodel (>= 4.2, < 5.1)
activerecord (>= 4.2, < 5.1)
request_store (~> 1.0)

GIT
remote: https://github.com/drapergem/draper.git
revision: ab51bf06d111c6278bd3bc0ca781655ae61cc4b9
specs:
draper (3.0.0.pre1)
actionpack (~> 5.0)
activemodel (~> 5.0)
activemodel-serializers-xml (~> 1.0)
activesupport (~> 5.0)
request_store (~> 1.0)

GIT
remote: https://github.com/ekho/capistrano-git-submodule-strategy.git
revision: 559f6b08992027b2380a54b1b4b4cf55a3f10680
specs:
capistrano-git-submodule-strategy (0.1.23)
capistrano (>= 3.1.0, < 3.7)

GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
Expand Down Expand Up @@ -111,10 +84,6 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
carrierwave (1.0.0)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
case_transform (0.2)
activesupport
childprocess (0.5.9)
Expand Down Expand Up @@ -159,6 +128,12 @@ GEM
database_cleaner (1.5.3)
debug_inspector (0.0.2)
diff-lcs (1.3)
draper (3.0.0.pre1)
actionpack (~> 5.0)
activemodel (~> 5.0)
activemodel-serializers-xml (~> 1.0)
activesupport (~> 5.0)
request_store (~> 1.0)
email_spec (2.1.0)
htmlentities (~> 4.3.3)
launchy (~> 2.1)
Expand Down Expand Up @@ -225,7 +200,6 @@ GEM
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
kgio (2.11.0)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.0.8)
Expand All @@ -249,7 +223,6 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.6.0)
mini_portile2 (2.1.0)
minitest (5.10.1)
money (6.8.1)
Expand All @@ -264,6 +237,9 @@ GEM
nio4r (1.2.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
passenger (5.1.2)
rack
rake (>= 0.8.1)
pg (0.19.0)
poltergeist (1.12.0)
capybara (~> 2.1)
Expand Down Expand Up @@ -304,7 +280,6 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.17.0)
rake (12.0.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
Expand Down Expand Up @@ -406,9 +381,6 @@ GEM
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
unicode_utils (1.4.0)
unicorn (5.2.0)
kgio (~> 2.6)
raindrops (~> 0.7)
web-console (3.4.0)
actionview (>= 5.0)
activemodel (>= 5.0)
Expand Down Expand Up @@ -436,21 +408,18 @@ DEPENDENCIES
byebug
capistrano (~> 3.6)
capistrano-bundler (~> 1.1.2)
capistrano-git-submodule-strategy (~> 0.1)!
capistrano-passenger
capistrano-rails (~> 1.1)
capybara
carrierwave
coffee-rails (~> 4.2)
country_select
cucumber-rails
database_cleaner
draper!
draper (= 3.0.0.pre1)
email_spec
factory_girl_rails
faraday
git
globalize!
haml-rails
htmlentities
jbuilder (~> 2.5)
Expand All @@ -461,7 +430,7 @@ DEPENDENCIES
launchy
listen (~> 3.0.5)
mailcatcher
mini_magick
passenger (>= 5.0.25)
pg (~> 0.18)
poltergeist
puma (~> 3.0)
Expand All @@ -485,11 +454,9 @@ DEPENDENCIES
swagger-blocks
syntax
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
unicorn
web-console
webmock

BUNDLED WITH
1.14.0
1.14.3
32 changes: 8 additions & 24 deletions src/ruby/meetings/config/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# config valid only for Capistrano 3.1
# See http://stackoverflow.com/questions/29168/deploying-a-git-subdirectory-in-capistrano/6969505#6969505 for instructions on how

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [129/80]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im ok with that

# to install from a subdirection
# As of Capistrano 3.3.3, you can now use the :repo_tree configuration variable,
# http://capistranorb.com/documentation/getting-started/configuration/
lock '3.6.1'
set :application, ->{YAML.load_file('config/deploy.yml')[fetch(:stage)][:directory]}
set :repo_url, ->{YAML.load_file('config/deploy.yml')[fetch(:stage)][:repo_url]}
Expand All @@ -8,11 +12,10 @@
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call

# Default deploy_to directory is /var/www/my_app
set :deploy_to, "/home/rails/muti/#{fetch(:stage)}"
set :deploy_to, "/home/rails/muti_tree/#{fetch(:stage)}"

# Default value for :scm is :git
# set :scm, :git
set :git_strategy, Capistrano::Git::SubmoduleStrategy
set :repo_tree, 'src/ruby/meetings'
# Default value for :format is :pretty
# set :format, :pretty
Expand All @@ -24,7 +27,7 @@
# set :pty, true

# Default value for :linked_files is []
set :linked_files, ['config/database.yml','config/secrets.yml','config/deploy.yml','config/environment_params.yml']
set :linked_files, ['config/database.yml','config/secrets.yml','config/environment_params.yml']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space missing after comma.
Line is too long. [95/80]


# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads}
Expand All @@ -35,24 +38,5 @@
# Default value for keep_releases is 5
# set :keep_releases, 5

namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
invoke 'unicorn:reload'
end
end
after :publishing, :restart

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


2 changes: 1 addition & 1 deletion src/ruby/meetings/config/deploy/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# server list. The second argument is a, or duck-types, Hash and is
# used to set extended properties on the server.
set :domain,YAML.load_file('config/deploy.yml')[fetch(:stage)][:domain]
server fetch(:domain), user: 'ubuntu', roles: %w{db web app}#, my_property: :my_value
server fetch(:domain), user: 'rails', roles: %w{db web app}#, my_property: :my_value

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%w-literals should be delimited by ( and ).
Missing space after #.
Put a space before an end-of-line comment.
Line is too long. [84/80]




Expand Down
2 changes: 1 addition & 1 deletion src/ruby/meetings/config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Expand Down
38 changes: 0 additions & 38 deletions src/ruby/meetings/config/unicorn/production.rb

This file was deleted.

Loading