Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Use recommended revision-based deploy provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
inopinatus committed Oct 7, 2020
1 parent 53e30e2 commit d41f60e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion recipes/deploy.rb
Expand Up @@ -21,7 +21,7 @@

fire_hook(:before_deploy, items: databases + [source, framework, appserver, worker, webserver])

deploy application['shortname'] do
deploy_revision application['shortname'] do
deploy_to deploy_dir(application)
user node['deployer']['user'] || 'root'
group www_group
Expand Down
2 changes: 1 addition & 1 deletion recipes/undeploy.rb
Expand Up @@ -16,7 +16,7 @@

fire_hook(:before_undeploy, items: databases + [source, framework, appserver, worker, webserver])

deploy application['shortname'] do
deploy_revision application['shortname'] do
deploy_to deploy_dir(application)
user node['deployer']['user'] || 'root'
group www_group
Expand Down
3 changes: 2 additions & 1 deletion templates/default/appserver.service.erb
Expand Up @@ -34,7 +34,8 @@ def different_gemfile?
current_gemfile = "#{ROOT_PATH}/current/Gemfile.lock"
if File.exists?(current_gemfile)
dir = Dir["#{ROOT_PATH}/releases/*"]
previous_release_path = dir.sort[dir.size-2]
previous_release_path = dir.sort_by { |d| ::File.ctime(d) }[-2]
if !previous_release_path.nil? && File.exists?("#{previous_release_path}/Gemfile.lock")
return Digest::MD5.hexdigest(File.read(current_gemfile)) != Digest::MD5.hexdigest(File.read("#{previous_release_path}/Gemfile.lock"))
end
Expand Down

0 comments on commit d41f60e

Please sign in to comment.