2021-07-18 00:04:18 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-10-08 15:31:29 +00:00
|
|
|
# Run from `ptth/`
|
2021-07-18 00:04:18 +00:00
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
GIT_COMMIT=$(git rev-parse main)
|
|
|
|
GIT_COMMIT_SHORT=$(echo "$GIT_COMMIT" | cut -b -8)
|
|
|
|
DOCKER_TAG="ptth_quic:latest"
|
|
|
|
|
|
|
|
mkdir -p app_packages
|
|
|
|
|
2022-10-09 14:19:01 +00:00
|
|
|
git archive --format=tar "$GIT_COMMIT" | docker build -f crates/ptth_quic/Dockerfile -t "$DOCKER_TAG" --build-arg "git_version=$GIT_COMMIT" -
|
2021-07-18 00:04:18 +00:00
|
|
|
|
2022-10-08 15:31:29 +00:00
|
|
|
docker run --rm "$DOCKER_TAG" \
|
2021-07-18 00:33:01 +00:00
|
|
|
tar -c \
|
|
|
|
app \
|
2022-10-09 14:19:01 +00:00
|
|
|
ptth_quic_relay_server \
|
2021-07-18 00:21:43 +00:00
|
|
|
| gzip > "app_packages/ptth_quic_relay_$GIT_COMMIT_SHORT.tar.gz"
|
2021-07-18 00:04:18 +00:00
|
|
|
|
2021-07-18 00:21:43 +00:00
|
|
|
# sudo docker build -f app_package_Dockerfile -t ptth_app_host:latest .
|