Skip to content

Commit e441cee

Browse files
authored
fix deploy.sh, remove .env (#159)
make .env file optional Signed-off-by: sallyom <somalley@redhat.com>
1 parent 0e4f12d commit e441cee

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

components/manifests/deploy.sh

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ set -e
1111
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1212
cd "$SCRIPT_DIR"
1313

14+
# Load .env file if it exists (optional for local CRC setups)
15+
if [ -f ".env" ]; then
16+
set -a # automatically export all variables
17+
source .env
18+
set +a
19+
fi
20+
1421
# Colors for output
1522
RED='\033[0;31m'
1623
GREEN='\033[0;32m'
@@ -180,20 +187,6 @@ if [ "${1:-}" = "secrets" ]; then
180187
exit 1
181188
fi
182189

183-
# Load .env
184-
echo -e "${YELLOW}Loading environment configuration (.env)...${NC}"
185-
ENV_FILE=".env"
186-
if [[ ! -f "$ENV_FILE" ]]; then
187-
echo -e "${RED}❌ .env file not found${NC}"
188-
echo -e "${YELLOW}Please create .env file from env.example:${NC}"
189-
echo " cp env.example .env"
190-
echo " # Edit .env and add your actual API key and Git configuration"
191-
exit 1
192-
fi
193-
set -a
194-
source "$ENV_FILE"
195-
set +a
196-
197190
# Generate secrets values like in full deploy
198191
OAUTH_ENV_FILE="oauth-secret.env"
199192
CLIENT_SECRET_VALUE="${OCP_OAUTH_CLIENT_SECRET:-}"
@@ -263,21 +256,6 @@ fi
263256
echo -e "${GREEN}✅ Authenticated as: $(oc whoami)${NC}"
264257
echo ""
265258

266-
# Load required environment file
267-
echo -e "${YELLOW}Loading environment configuration (.env)...${NC}"
268-
ENV_FILE=".env"
269-
if [[ ! -f "$ENV_FILE" ]]; then
270-
echo -e "${RED}❌ .env file not found${NC}"
271-
echo -e "${YELLOW}Please create .env file from env.example:${NC}"
272-
echo " cp env.example .env"
273-
echo " # Edit .env and add your actual API key and Git configuration"
274-
exit 1
275-
fi
276-
set -a
277-
source "$ENV_FILE"
278-
set +a
279-
echo ""
280-
281259
# Prepare oauth secret env file for kustomize secretGenerator
282260
echo -e "${YELLOW}Preparing oauth secret env for kustomize...${NC}"
283261
OAUTH_ENV_FILE="oauth-secret.env"

0 commit comments

Comments
 (0)