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

Commit

Permalink
fix(appserver): Compare lockfiles instead of main Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aschuster3 authored and ajgon committed Apr 10, 2019
1 parent b576788 commit c02af02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/default/appserver.service.erb
Expand Up @@ -31,11 +31,12 @@ def running?
end
def different_gemfile?
if File.exists?("#{ROOT_PATH}/current/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]
if !previous_release_path.nil? && File.exists?("#{previous_release_path}/Gemfile")
return Digest::MD5.hexdigest(File.read("#{ROOT_PATH}/current/Gemfile")) != Digest::MD5.hexdigest(File.read("#{previous_release_path}/Gemfile"))
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
end
false
Expand Down

0 comments on commit c02af02

Please sign in to comment.