Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running deploy.sh to just update secrets #410

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,33 @@ if [ -z "$SKIP_SECRETS" ] ; then
fi

# Upload and deploy the package
zip -rq $package $(<package.json jq -re .files[],.deployFiles[])
if [ -z "$SKIP_DEPLOY" ] ; then
zip -rq $package $(<package.json jq -re .files[],.deployFiles[])

aws s3 cp \
--region $region \
$package s3://$bucket/$package
aws s3 cp \
--region $region \
$package s3://$bucket/$package

aws cloudformation deploy \
--region $region \
--capabilities CAPABILITY_IAM \
--template template.yml \
--stack-name $stack \
--parameter-overrides \
Bucket=$bucket \
Package=$package \
Version=$version
aws cloudformation deploy \
--region $region \
--capabilities CAPABILITY_IAM \
--template template.yml \
--stack-name $stack \
--parameter-overrides \
Bucket=$bucket \
Package=$package \
Version=$version

rm -f $package
rm -f $package

# Register the Telegram webhook
endpoint=$(aws cloudformation describe-stacks \
--region $region \
--stack-name $stack \
--query "Stacks[0].Outputs[?OutputKey=='Endpoint'].OutputValue" \
--output text \
)
echo Endpoint: $endpoint
# Register the Telegram webhook
endpoint=$(aws cloudformation describe-stacks \
--region $region \
--stack-name $stack \
--query "Stacks[0].Outputs[?OutputKey=='Endpoint'].OutputValue" \
--output text \
)
echo Endpoint: $endpoint

node src/register.js "${endpoint}telegram"
node src/register.js "${endpoint}telegram"
fi