Skip to content

Commit

Permalink
Set $REVISION in start script (#141)
Browse files Browse the repository at this point in the history
* Use commit_id.txt for revision & keep env var

* Set  in start script
  • Loading branch information
zwolf authored Mar 25, 2022
1 parent c120a3a commit daa9063
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ RUN mix deps.get

ADD . /app

# Check for a commit_id.txt file: if missing, use default
RUN export COMMIT_ID=$(cat commit_id.txt)
RUN REVISION="${COMMIT_ID:-asdf123jkl456}"
ENV REVISION=$REVISION

ENV MIX_ENV prod

RUN mix compile
Expand Down
4 changes: 4 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# set REVISION env var from commit_id.txt or default
COMMIT_ID=$(cat commit_id.txt 2> /dev/null)
REVISION="${COMMIT_ID:-asdf123jkl456}"

# ensure we stop on error (-e) and log cmds (-x)
set -ex
ERLANG_NODE_NAME=${ERLANG_NODE_NAME:-erlang@designator.zooniverse.org}
Expand Down

0 comments on commit daa9063

Please sign in to comment.