From 2f2c60126c0efc63da49226b41c4b8356918256d Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Sun, 1 Feb 2026 19:24:37 +0100 Subject: [PATCH] feat(deploy): improve environment variable handling and deployment workflow - Update .vars to properly export deployment configuration variables - Modify deploy.sh to conditionally source .vars only in interactive mode - Remove include directive from makefile to prevent automatic variable loading - Enhance deployment script reliability by ensuring proper environment setup --- .vars | 4 ++-- deploy.sh | 4 ++++ makefile | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.vars b/.vars index ab1f93c..7c8066f 100644 --- a/.vars +++ b/.vars @@ -1,4 +1,4 @@ #/usr/bin/env bash -"${DEPLOYMENT_HOST:=docker.infra.bjphoster.cloud}" -"${DEPLOYMENT_PATH:=/opt/pedini.dev}" +export DEPLOYMENT_HOST=docker.infra.bjphoster.cloud +export DEPLOYMENT_PATH=/opt/pedini.dev diff --git a/deploy.sh b/deploy.sh index 5331b35..2cf71d3 100755 --- a/deploy.sh +++ b/deploy.sh @@ -12,6 +12,10 @@ set -e # then remove everything in the data path, untar the tarball and reload the server # finally remove the tarball, both from the remote host and locally (cleanup) +if [ -t 0 ]; then # Interactive: prompt user + source .vars +fi + # Check if the username variable is set if [ ! -z "${SSH_USERNAME}" ]; then SSH_USERNAME="${SSH_USERNAME}@" diff --git a/makefile b/makefile index 3e8f55a..2184bec 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,4 @@ #!make -include .vars default: build