Skip to content

Commit

Permalink
Fix CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Jan 25, 2024
1 parent b3f2fe1 commit 06c6ed0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ COPY --from=node-downloader /usr/local/lib/node_modules/esbuild/bin/esbuild /usr
COPY --from=ruby-builder /usr/local/bundle /usr/local/bundle

# Bust cache if local git ref changes and add it to the image
ADD .git/refs/heads/master /docker/git_master_ref
ADD .git/refs/heads/maste? /docker/git_master_ref
7 changes: 6 additions & 1 deletion app/logical/docker_env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ def dev_mode?
end

def master_commit
@master_commit ||= File.read("/docker/git_master_ref").first(GitHelper::COMMIT_ABREV_LENGTH)
@master_commit ||= begin
File.read("/docker/git_master_ref").first(GitHelper::COMMIT_ABREV_LENGTH)
rescue Errno::ENOENT
# The .git folder doesn't exist during build on CI for some reason
"unknown"
end
end

def docker_relevant_files
Expand Down

0 comments on commit 06c6ed0

Please sign in to comment.