Skip to content
Permalink
Browse files

deploy settings

  • Loading branch information
nna774 committed Sep 16, 2018
1 parent 788a577 commit da26bae946114b923c0e83471fa3bf95d0590d50
Showing with 15 additions and 12 deletions.
  1. +11 −8 itamae/cookbooks/app/default.rb
  2. +1 −1 itamae/hosts/isucon1.yml
  3. +1 −1 itamae/hosts/isucon2.yml
  4. +1 −1 itamae/hosts/isucon3.yml
  5. +1 −1 itamae/site.rb
@@ -15,15 +15,18 @@
execute 'deploy app' do
user node[:user]
command <<"EOC"
DIR=#{node[:deploy_to]}.back/`date +%d%H%M%S` &&\
mkdir -p $DIR;
[ -e #{node[:deploy_to]} ] && rsync -au --remove-source-files #{node[:deploy_to]}/ $DIR/;
ln -sf $DIR #{node[:deploy_to]}.back/current;
rm -fr "#{node[:deploy_to]}-clone";
GIT_SSH=#{git_ssh} git clone #{node[:repository]} #{node[:deploy_to]}-clone &&\
ln -sf #{node[:deploy_to]}-clone/app #{node[:deploy_to]}
GIT_SSH=#{git_ssh} git pull
ln -sf #{node[:deploy_to]}-tmp/app/webapp #{node[:deploy_to]}/webapp
EOC
notifies :run, 'execute[app restart]'
cwd "#{node[:deploy_to]}-tmp"
end

execute 'bundle i' do
user node[:user]
command <<"EOC"
~/local/ruby/bin/bundle install
EOC
cwd "#{node[:deploy_to]}/webapp/ruby"
end

execute 'app restart' do
@@ -2,5 +2,5 @@ isucon1:
properties:
run_list:
- roles/base/default.rb
# - cookbooks/app/default.rb
- cookbooks/app/default.rb
# - cookbooks/nginx/default.rb
@@ -2,5 +2,5 @@ isucon2:
properties:
run_list:
- roles/base/default.rb
# - cookbooks/app/default.rb
- cookbooks/app/default.rb
# - cookbooks/nginx/default.rb
@@ -2,5 +2,5 @@ isucon3:
properties:
run_list:
- roles/base/default.rb
# - cookbooks/app/default.rb
- cookbooks/app/default.rb
# - cookbooks/nginx/default.rb
@@ -1,7 +1,7 @@
node[:repository] = 'git@github.com:nna774/isucon8-suburi-pixiv-isucon.git'
node[:user] = 'isucon'
node[:home] = "/home/#{node[:user]}"
node[:deploy_to] = "#{node[:home]}/deploy"
node[:deploy_to] = "#{node[:home]}/torb"
node[:static_dir] = "#{node[:deploy_to]}/public"
node[:app_restart] = 'echo hello'

0 comments on commit da26bae

Please sign in to comment.
You can’t perform that action at this time.