From ad2f09457c428dbcd573320d4969c0a8e52bbb14 Mon Sep 17 00:00:00 2001 From: Haelnorr Date: Sun, 16 Feb 2025 22:58:57 +1100 Subject: [PATCH] Fixes to deployment --- .github/workflows/deploy_staging.yaml | 2 +- Makefile | 6 +++--- deploy/deploy_staging.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_staging.yaml b/.github/workflows/deploy_staging.yaml index 21f7705..cbfa863 100644 --- a/.github/workflows/deploy_staging.yaml +++ b/.github/workflows/deploy_staging.yaml @@ -31,7 +31,7 @@ jobs: run: make test - name: Build the binary - run: make build + run: make build SUFFIX=-staging-$GITHUB_SHA - name: Deploy to Server env: diff --git a/Makefile b/Makefile index 77c65c4..a8dc81f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: go mod tidy && \ templ generate && \ go generate && \ - go build -ldflags="-w -s" -o ${BINARY_NAME} + go build -ldflags="-w -s" -o ${BINARY_NAME}${SUFFIX} dev: templ generate --watch &\ @@ -19,11 +19,11 @@ tester: go run . --port 3232 --test --loglevel trace test: - rm -f **/.projectreshoot-test-database.db + rm -f **/.projectreshoot-test-database.db && \ go mod tidy && \ templ generate && \ go generate && \ - go test ./... + go test ./middleware clean: go clean diff --git a/deploy/deploy_staging.sh b/deploy/deploy_staging.sh index e7c77bf..3ada4c5 100644 --- a/deploy/deploy_staging.sh +++ b/deploy/deploy_staging.sh @@ -13,7 +13,7 @@ COMMIT_HASH=$1 RELEASES_DIR="/home/deploy/releases/staging" DEPLOY_BIN="/home/deploy/staging/projectreshoot" SERVICE_NAME="staging.projectreshoot" -BINARY_NAME="projectreshoot-${COMMIT_HASH}" +BINARY_NAME="projectreshoot-staging-${COMMIT_HASH}" declare -a PORTS=("3005" "3006" "3007") # Check if the binary exists