ptth/build_app_package.bash

15 lines
456 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)
mkdir -p app_packages
git archive --format=tar "$GIT_COMMIT" | sudo docker build -t ptth:latest --build-arg "git_version=$GIT_COMMIT" -
sudo docker run --rm ptth:latest tar -c ptth_relay handlebars | gzip > "app_packages/ptth_relay_$GIT_COMMIT_SHORT.tar.gz"
sudo docker build -f app_package_Dockerfile -t ptth_app_host:latest .