Skip to content

Commit 5c719c1

Browse files
committed
fetch revision from REVISION env var
1 parent 2f0208e commit 5c719c1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ ARG BUNDLE_PATH=vendor/bundle
1919
ENV BUNDLE_PATH ${BUNDLE_PATH}
2020
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}
2121

22+
ARG REVISION
23+
ENV REVISION=$REVISION
24+
2225
RUN mkdir /app
2326
WORKDIR /app
2427
RUN mkdir -p tmp/pids

config/application.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
module RubyDocs
1010
class Application < Rails::Application
1111
config.load_defaults 7.0
12-
config.revision = `git rev-parse --short HEAD 2> /dev/null`.chomp.presence ||
13-
ENV["FLY_IMAGE_REF"]&.then { _1[/@sha256:([0-9a-f]+)/, 1] } or
12+
config.revision = ENV["REVISION"].presence ||
13+
`git rev-parse HEAD 2> /dev/null`.chomp.presence or
1414
raise "Could not determine revision."
1515

1616
config.action_mailer.delivery_method = :postmark

0 commit comments

Comments
 (0)