Skip to content

Commit

Permalink
deploy settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nna774 committed Sep 16, 2018
1 parent 788a577 commit da26bae
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
19 changes: 11 additions & 8 deletions itamae/cookbooks/app/default.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion itamae/hosts/isucon1.yml
Expand Up @@ -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 changes: 1 addition & 1 deletion itamae/hosts/isucon2.yml
Expand Up @@ -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 changes: 1 addition & 1 deletion itamae/hosts/isucon3.yml
Expand Up @@ -2,5 +2,5 @@ isucon3:
properties:
run_list:
- roles/base/default.rb
# - cookbooks/app/default.rb
- cookbooks/app/default.rb
# - cookbooks/nginx/default.rb
2 changes: 1 addition & 1 deletion itamae/site.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'

Expand Down

0 comments on commit da26bae

Please sign in to comment.