ptth/crates/ptth_quic/build_app_package.bash

21 lines
550 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# Run from `ptth/`
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
git archive --format=tar "$GIT_COMMIT" | docker build -f crates/ptth_quic/Dockerfile -t "$DOCKER_TAG" --build-arg "git_version=$GIT_COMMIT" -
docker run --rm "$DOCKER_TAG" \
tar -c \
app \
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:21:43 +00:00
# sudo docker build -f app_package_Dockerfile -t ptth_app_host:latest .