Added SSL cert generation and installation. Moved variables to ENV
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m15s
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m15s
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load environment variables from .env file if it exists
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | xargs)
|
||||
fi
|
||||
|
||||
# Check if required environment variables are set
|
||||
if [ -z "$FREEDNS_User" ] || [ -z "$FREEDNS_Password" ] || [ -z "$DOMAIN_NAME" ]; then
|
||||
echo "Error: FREEDNS_User, FREEDNS_Password, and DOMAIN_NAME must be set as environment variables or in a .env file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Deploy infrastructure
|
||||
cdk deploy
|
||||
cdk deploy --app="python3 ${PWD}/app.py"
|
||||
|
||||
# Update application on running instances
|
||||
INSTANCE_IDS=$(aws ec2 describe-instances \
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load environment variables from .env file if it exists
|
||||
if [ -f ${PWD}/.env ]; then
|
||||
export $(cat ${PWD}/.env | xargs)
|
||||
fi
|
||||
|
||||
# Check if required environment variables are set
|
||||
if [ -z "$FREEDNS_User" ] || [ -z "$FREEDNS_Password" ] || [ -z "$DOMAIN_NAME" ]; then
|
||||
echo "Error: FREEDNS_User, FREEDNS_Password, and DOMAIN_NAME must be set as environment variables or in a .env file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Optional: Print the variables being used (for verification)
|
||||
echo "Using DOMAIN_NAME: $DOMAIN_NAME"
|
||||
echo "Using FREEDNS_User: $FREEDNS_User" # Be cautious printing passwords
|
||||
|
||||
# Destroy infrastructure
|
||||
cdk destroy --force
|
||||
cdk destroy --app="python3 ${PWD}/app.py" --force
|
||||
Reference in New Issue
Block a user