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