forked from lanjelot/patator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to build and push docker image to dockerhub
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
DOCKER_IMAGE='lanjelot/patator' | ||
GIT_REPO='https://github.com/lanjelot/patator' | ||
TMP_COPY=$(mktemp -d) | ||
|
||
git clone -b master $GIT_REPO $TMP_COPY | ||
cd $TMP_COPY | ||
VERSION=$(echo `git tag|sort -V|tail -1`-`git rev-parse --verify HEAD|cut -b -7`) | ||
sed -i -e "s,^__version__.*$,__version__ = '$VERSION'," patator.py | ||
docker build . -t $DOCKER_IMAGE:$VERSION -t $DOCKER_IMAGE:latest | ||
|
||
docker login | ||
docker push $DOCKER_IMAGE |