Skip to content

Commit

Permalink
Add script to build and push docker image to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
lanjelot committed Jan 29, 2021
1 parent 452819f commit 642a6f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Many thanks! [@lanjelot](https://twitter.com/lanjelot)

```
git clone https://github.com/lanjelot/patator.git
docker build -t patator patator/
git clone https://github.com/danielmiessler/SecLists.git
docker build -t patator patator/
docker run -it --rm -v $PWD/SecLists/Passwords:/mnt patator dummy_test data=FILE0 0=/mnt/richelieu-french-top5000.txt
```

Expand Down
16 changes: 16 additions & 0 deletions release.sh
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

0 comments on commit 642a6f4

Please sign in to comment.