Add README, Dockerfile and build script
[vaultmon/.git] / build.sh
1 #!/bin/bash
2
3 set -e
4
5 EXTRA_ARGS="$@"
6
7 IMAGE="gonitro/${PWD##*/}"
8 TAG=$(git rev-parse --short HEAD)
9 IMAGE_NAME="${IMAGE}:${TAG}"
10
11 echo Building Docker image ${IMAGE_NAME}
12 docker build -t ${IMAGE_NAME} ${EXTRA_ARGS} .
13 [[ $? -eq 0 ]] && {
14     docker tag ${IMAGE_NAME} ${IMAGE}:latest
15     echo Publishing ${IMAGE_NAME}
16     docker push ${IMAGE_NAME}
17     docker push ${IMAGE}:latest
18 }