From d3b47d18d15b40d5adcf47b0cb0fa22909b5a6fa Mon Sep 17 00:00:00 2001 From: _ <> Date: Sat, 20 Feb 2021 19:23:00 +0000 Subject: [PATCH] :package: build: tidy up app_package style deployment --- build_app_package.bash | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build_app_package.bash b/build_app_package.bash index 4eb8b68..d8f7f5c 100755 --- a/build_app_package.bash +++ b/build_app_package.bash @@ -1,9 +1,14 @@ #!/usr/bin/env bash -GIT_COMMITISH=$(git rev-parse main) +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_COMMITISH" | sudo docker build -t ptth:latest --build-arg "git_version=$GIT_COMMITISH" - +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/garbage.tar.gz +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 .