2019-08-17 18:37:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-05-17 20:22:40 +00:00
|
|
|
set -euo pipefail
|
|
|
|
set -x
|
|
|
|
|
2019-08-17 18:37:34 +00:00
|
|
|
CURRENT_DIR=$(dirname "$BASH_SOURCE")
|
|
|
|
|
2020-05-17 11:48:17 +00:00
|
|
|
GIT_SHA1="$(git rev-parse HEAD)"
|
2020-05-17 20:22:40 +00:00
|
|
|
GIT_SHORT_ID="${GIT_SHA1:0:8}"
|
|
|
|
GIT_TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/null || echo "")
|
2020-05-17 11:48:17 +00:00
|
|
|
|
|
|
|
DOCKER_TAG="${GIT_TAG:-$GIT_SHORT_ID}"
|
|
|
|
|
2020-05-17 20:22:40 +00:00
|
|
|
docker build --build-arg RUNTIME=hackmdio/runtime:node-10-0baafb79 -t "hackmdio/hackmd:$DOCKER_TAG" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."
|
2020-05-17 11:48:17 +00:00
|
|
|
|
2020-05-17 20:22:40 +00:00
|
|
|
docker build --build-arg RUNTIME=hackmdio/runtime:node-10-cjk-0baafb79 -t "hackmdio/hackmd:$DOCKER_TAG-cjk" -f "$CURRENT_DIR/Dockerfile" "$CURRENT_DIR/.."
|