ptth/build_app_package.bash

20 lines
509 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
GIT_COMMIT=$(git rev-parse main)
GIT_COMMIT_SHORT=$(echo "$GIT_COMMIT" | cut -b -8)
2021-07-10 22:17:23 +00:00
DOCKER_TAG="ptth:latest"
mkdir -p app_packages
2021-07-10 22:17:23 +00:00
git archive --format=tar "$GIT_COMMIT" | sudo docker build -t "$DOCKER_TAG" --build-arg "git_version=$GIT_COMMIT" -
2021-07-10 22:17:23 +00:00
sudo docker run --rm "$DOCKER_TAG" tar -c \
2021-02-20 21:34:19 +00:00
ptth_relay \
handlebars \
git_version.txt \
| gzip > "app_packages/ptth_relay_$GIT_COMMIT_SHORT.tar.gz"
sudo docker build -f app_package_Dockerfile -t ptth_app_host:latest .