diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 47906f1c..3bd88e96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ stages: build: stage: build script: - - docker build . -t "cmc:latest" + - docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) . -t "cmc:latest" deploy_staging: stage: deploy diff --git a/Dockerfile b/Dockerfile index d4ec656d..6019ff6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,8 @@ ENV APACHE_LOG_DIR /var/log/apache2 ENV APACHE_LOCK_DIR /var/lock/apache2 ENV APACHE_PID_FILE /var/run/apache2.pid +ENV COMMIT_SHA=${COMMIT} + EXPOSE 80 # Copy site into place. diff --git a/app/views/layouts/default.ctp b/app/views/layouts/default.ctp index f29a23da..c44f6dfd 100755 --- a/app/views/layouts/default.ctp +++ b/app/views/layouts/default.ctp @@ -172,7 +172,7 @@ endif;