Moved ssh public key to an environment variable
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m14s
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m14s
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load environment variables from .env file if it exists
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | xargs)
|
||||
if [ -f ${PWD}/.env ]; then
|
||||
# Use set -a to automatically export all variables
|
||||
set -a
|
||||
source ${PWD}/.env
|
||||
set +a
|
||||
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."
|
||||
if [ -z "$FREEDNS_User" ] || [ -z "$FREEDNS_Password" ] || [ -z "$DOMAIN_NAME" ] || [ -z "$SSH_PUBLIC_KEY" ]; then
|
||||
echo "Error: FREEDNS_User, FREEDNS_Password, DOMAIN_NAME, and SSH_PUBLIC_KEY must be set as environment variables or in a .env file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user