mirror of
https://github.com/sartography/cr-connect-db.git
synced 2025-01-09 06:22:43 +00:00
Adds git commit message to Dockerfile entrypoint
This commit is contained in:
parent
615b1c9469
commit
604534553b
@ -1,3 +1,6 @@
|
|||||||
FROM postgres
|
FROM postgres
|
||||||
|
ARG GIT_COMMIT=""
|
||||||
|
RUN echo "GIT_COMMIT = ${GIT_COMMIT}"
|
||||||
COPY ./initdb.sh /docker-entrypoint-initdb.d/initdb.sh
|
COPY ./initdb.sh /docker-entrypoint-initdb.d/initdb.sh
|
||||||
|
CMD echo 'echo "git commit = ${GIT_COMMIT}"' >> /docker-entrypoint-initdb.d/initdb.sh
|
||||||
EXPOSE 5432
|
EXPOSE 5432
|
||||||
|
@ -7,7 +7,7 @@ REPO="sartography/cr-connect-$APP"
|
|||||||
TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi)
|
TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH" ; fi)
|
||||||
COMMIT=${TRAVIS_COMMIT::8}
|
COMMIT=${TRAVIS_COMMIT::8}
|
||||||
|
|
||||||
docker build -f Dockerfile -t "$REPO:$COMMIT" .
|
docker build -f Dockerfile -t "$REPO:$COMMIT" --build-arg GIT_COMMIT="$REPO:$COMMIT" .
|
||||||
docker tag "$REPO:$COMMIT" "$REPO:$TAG"
|
docker tag "$REPO:$COMMIT" "$REPO:$TAG"
|
||||||
docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER"
|
docker tag "$REPO:$COMMIT" "$REPO:travis-$TRAVIS_BUILD_NUMBER"
|
||||||
docker push "$REPO"
|
docker push "$REPO"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user