Voice data server for navigation voice changer app.
Revision | 11129217b3fd7e15f99e9b9a6534a0447e297175 (tree) |
---|---|
Time | 2016-09-29 23:06:36 |
Author | HMML <hmml3939@gmai...> |
Commiter | HMML |
Update capistrano and add docker deploy setting.
@@ -1,4 +1,28 @@ | ||
1 | -load 'deploy' | |
2 | -# Uncomment if you are using Rails' asset pipeline | |
3 | -load 'deploy/assets' | |
4 | -load 'config/deploy' # remove this line to skip loading any of the default tasks | |
1 | +# Load DSL and set up stages | |
2 | +require "capistrano/setup" | |
3 | + | |
4 | +# Include default deployment tasks | |
5 | +require "capistrano/deploy" | |
6 | + | |
7 | +# Include tasks from other gems included in your Gemfile | |
8 | +# | |
9 | +# For documentation on these, see for example: | |
10 | +# | |
11 | +# https://github.com/capistrano/rvm | |
12 | +# https://github.com/capistrano/rbenv | |
13 | +# https://github.com/capistrano/chruby | |
14 | +# https://github.com/capistrano/bundler | |
15 | +# https://github.com/capistrano/rails | |
16 | +# https://github.com/capistrano/passenger | |
17 | +# | |
18 | +# require 'capistrano/rvm' | |
19 | +# require 'capistrano/rbenv' | |
20 | +# require 'capistrano/chruby' | |
21 | +require 'capistrano/bundler' | |
22 | +require 'capistrano/rails/assets' | |
23 | +require 'capistrano/rails/migrations' | |
24 | +require 'capistrano/passenger' | |
25 | +require 'capistrano/deploy_into_docker' | |
26 | + | |
27 | +# Load custom tasks from `lib/capistrano/tasks` if you have any defined | |
28 | +Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r } |
@@ -0,0 +1,12 @@ | ||
1 | +FROM ruby:latest | |
2 | +ENV DEBIAN_FRONTEND noninteractive | |
3 | +RUN apt update | |
4 | +RUN apt -y full-upgrade | |
5 | +RUN apt -y install file sox libsox-fmt-mp3 libsox-fmt-base | |
6 | +RUN apt -y install libsqlite3-dev | |
7 | +RUN apt-get clean | |
8 | +RUN adduser --system --disabled-password --uid 3000 --group --home /var/local/app rails | |
9 | +RUN gem install bundler --no-rdoc --no-ri | |
10 | +USER rails | |
11 | +ENV BUNDLE_APP_CONFIG /var/local/app/.bundle | |
12 | +CMD cd /var/local/app/current && exec bin/rails server |
@@ -64,7 +64,9 @@ gem 'rubyzip', '< 1.0.0', require: 'zip/zip' | ||
64 | 64 | gem 'rails_admin' |
65 | 65 | group :develpment do |
66 | 66 | gem 'capistrano' |
67 | - gem 'capistrano-ext' | |
68 | - gem 'capistrano_colors' | |
67 | + gem 'capistrano-bundler' | |
68 | + gem 'capistrano-rails' | |
69 | + gem 'capistrano-passenger' | |
70 | + gem 'capistrano-deploy_into_docker' | |
69 | 71 | end |
70 | 72 | gem 'exception_notification', group: :production |
@@ -51,10 +51,17 @@ GEM | ||
51 | 51 | i18n |
52 | 52 | rake (>= 10.0.0) |
53 | 53 | sshkit (>= 1.9.0) |
54 | - capistrano-ext (1.2.1) | |
55 | - capistrano (>= 1.0.0) | |
54 | + capistrano-bundler (1.1.4) | |
55 | + capistrano (~> 3.1) | |
56 | + sshkit (~> 1.2) | |
57 | + capistrano-deploy_into_docker (0.2.0) | |
58 | + sshkit-backend-docker | |
56 | 59 | capistrano-harrow (0.5.3) |
57 | - capistrano_colors (0.5.5) | |
60 | + capistrano-passenger (0.2.0) | |
61 | + capistrano (~> 3.0) | |
62 | + capistrano-rails (1.1.7) | |
63 | + capistrano (~> 3.1) | |
64 | + capistrano-bundler (~> 1.1) | |
58 | 65 | client_side_validations (4.2.6) |
59 | 66 | jquery-rails (>= 3.1.2, < 5.0.0) |
60 | 67 | js_regex (~> 1.0, >= 1.0.9) |
@@ -242,6 +249,8 @@ GEM | ||
242 | 249 | sshkit (1.11.3) |
243 | 250 | net-scp (>= 1.1.2) |
244 | 251 | net-ssh (>= 2.8.0) |
252 | + sshkit-backend-docker (0.1.0) | |
253 | + sshkit (>= 1.9.0) | |
245 | 254 | therubyracer (0.12.2) |
246 | 255 | libv8 (~> 3.16.14.0) |
247 | 256 | ref |
@@ -262,8 +271,10 @@ PLATFORMS | ||
262 | 271 | DEPENDENCIES |
263 | 272 | bootstrap-sass |
264 | 273 | capistrano |
265 | - capistrano-ext | |
266 | - capistrano_colors | |
274 | + capistrano-bundler | |
275 | + capistrano-deploy_into_docker | |
276 | + capistrano-passenger | |
277 | + capistrano-rails | |
267 | 278 | client_side_validations |
268 | 279 | client_side_validations-simple_form |
269 | 280 | coffee-rails (~> 4.0.0) |
@@ -1,37 +1,18 @@ | ||
1 | -require 'bundler/capistrano' | |
2 | - | |
3 | -set :stages, %w(production homedev) | |
4 | -set :default_stage, "homedev" | |
5 | -require 'capistrano/ext/multistage' | |
6 | - | |
7 | -set :application, "NVC Serv" | |
8 | -set :repository, "git://git.pf.sourceforge.jp/gitroot/h/hm/hmml/nvc_serv.git" | |
1 | +set :application, "NVC_Serv" | |
2 | +set :repo_url, "git://git.pf.sourceforge.jp/gitroot/h/hm/hmml/nvc_serv.git" | |
9 | 3 | set :scm, :git |
10 | 4 | set :branch, 'master' |
11 | -set :rails_env, :production | |
12 | - | |
13 | -# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names | |
14 | -# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` | |
15 | - | |
16 | -#role :web, "localhost" # Your HTTP server, Apache/etc | |
17 | -#role :app, "localhost" # This may be the same as your `Web` server | |
18 | -#role :db, "localhost", :primary => true # This is where Rails migrations will run | |
5 | +fetch(:default_env).merge!(rails_env: :production) | |
19 | 6 | |
20 | -# if you want to clean up old releases on each deploy uncomment this: | |
21 | -# after "deploy:restart", "deploy:cleanup" | |
7 | +set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml', 'config/initializers/z90_local.rb') | |
8 | +set :linked_dirs, %w{log tmp/sockets public/system} | |
22 | 9 | |
23 | -after 'deploy:update_code', 'deploy:migrate' | |
24 | -before "deploy", "deploy:setup" | |
25 | - | |
26 | - | |
27 | -# if you're still using the script/reaper helper you will need | |
28 | -# these http://github.com/rails/irs_process_scripts | |
29 | - | |
30 | -# If you are using Passenger mod_rails uncomment this: | |
31 | 10 | namespace :deploy do |
32 | - task :start do ; end | |
33 | - task :stop do ; end | |
34 | - task :restart, :roles => :app, :except => { :no_release => true } do | |
35 | - run "touch #{File.join(current_path,'tmp','restart.txt')}" | |
11 | + task :fix_asset_perms do | |
12 | + on roles(:web), in: :sequence do | |
13 | + execute "chmod o+r -R #{release_path}/public/assets" | |
14 | + end | |
36 | 15 | end |
16 | + after "deploy:assets:precompile", "deploy:fix_asset_perms" | |
37 | 17 | end |
18 | + |
@@ -0,0 +1,18 @@ | ||
1 | +set :sshkit_backend, SSHKit::Backend::Docker | |
2 | +set :stage, :development | |
3 | +set :branch, 'master' | |
4 | +set :deploy_to, '/var/local/app' | |
5 | +set :repo_url, '/src' | |
6 | +fetch(:default_env).merge!(rails_env: :development, SECRET_KEY_BASE: 'dummy', DEVISE_SECRET_KEY: 'dummy') | |
7 | +set :bundle_without, 'test' | |
8 | + | |
9 | +fetch(:linked_dirs, []).clear | |
10 | +fetch(:linked_files, []).clear | |
11 | + | |
12 | +server docker: { | |
13 | + image: 'nvc-base', | |
14 | + commit: 'nvc-test', | |
15 | + volume: "#{Dir.pwd}:/src", | |
16 | +}, user: 'rails:rails', roles: %w{web app} | |
17 | + | |
18 | +Rake::Task["passenger:restart"].clear |
@@ -0,0 +1,15 @@ | ||
1 | +set :sshkit_backend, SSHKit::Backend::Docker | |
2 | +set :stage, :development | |
3 | +set :branch, 'master' | |
4 | +set :deploy_to, '/var/local/app' | |
5 | +fetch(:default_env).merge!(rails_env: :production, SECRET_KEY_BASE: 'dummy', DEVISE_SECRET_KEY: 'dummy') | |
6 | + | |
7 | +fetch(:linked_dirs, []).clear | |
8 | +fetch(:linked_files, []).clear | |
9 | + | |
10 | +server docker: { | |
11 | + image: 'nvc-base', | |
12 | + commit: 'nvc', | |
13 | +}, user: 'rails:rails', roles: %w{web app} | |
14 | + | |
15 | +Rake::Task["passenger:restart"].clear |
@@ -3,9 +3,7 @@ role :app, 'nvc.nekoteki.jp' | ||
3 | 3 | role :db, 'nvc.nekoteki.jp', primary: true |
4 | 4 | set :user, 'nvc' |
5 | 5 | set :deploy_to, '/var/local/nvc/app' |
6 | -set :use_sudo, false | |
7 | 6 | set :branch, 'release' |
8 | -set :git_shallow_clone, 1 | |
9 | 7 | after "deploy:finalize_update", :override_local_settings |
10 | 8 | task :override_local_settings do |
11 | 9 | run "cp -av #{release_path}/../../config/* #{release_path}/config/" |