Skip to content

Commit

Permalink
Add a script for pushing images to the Docker Hub
Browse files Browse the repository at this point in the history
Also adds Git SHA environment variable for production images.
  • Loading branch information
gentlecat committed Jun 30, 2017
1 parent 710e3f5 commit 2c1b0d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@ ADD ./docker/prod/cron/jobs /tmp/crontab
RUN crontab /tmp/crontab
RUN rm /tmp/crontab

ARG GIT_COMMIT_SHA
ENV GIT_SHA ${GIT_COMMIT_SHA}

EXPOSE 13032
13 changes: 13 additions & 0 deletions docker/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#
# Build image from the currently checked out version of CritiqueBrainz
# and push it to the Docker Hub, with an optional tag (by default "latest").
#
# Usage:
# $ ./push.sh [tag]

cd "$(dirname "${BASH_SOURCE[0]}")/../"

TAG_PART=${1:-latest}
docker build -t metabrainz/critiquebrainz:$TAG_PART --build-arg GIT_COMMIT_SHA=$(git rev-parse HEAD) .
docker push metabrainz/critiquebrainz:$TAG_PART

0 comments on commit 2c1b0d5

Please sign in to comment.