chore: deploy prod to aws
This commit is contained in:
27
scripts/import-env.sh
Executable file
27
scripts/import-env.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PREFIX="/ghostv2"
|
||||
REGION="ca-central-1"
|
||||
WRITE="$1"
|
||||
|
||||
while getopts "w" opt; do
|
||||
case $opt in
|
||||
w) WRITE=true ;;
|
||||
*) echo "Usage $0 [-w]" && exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
while IFS='=' read -r key value; do
|
||||
[[ -z "$key" || "$key" =~ ^# ]] && continue
|
||||
|
||||
echo "Creating parameter: $PREFIX/$key"
|
||||
|
||||
if [[ "$WRITE" == "true" ]]; then
|
||||
aws ssm put-parameter \
|
||||
--name "$PREFIX/$key" \
|
||||
--value "$value" \
|
||||
--type SecureString \
|
||||
--overwrite \
|
||||
--region "$REGION" > /dev/null
|
||||
fi
|
||||
done < api/.env
|
||||
Reference in New Issue
Block a user