Skip to content

Commit

Permalink
Add Stack version (#6)
Browse files Browse the repository at this point in the history
\
  • Loading branch information
lloesche authored Feb 21, 2024
1 parent 227ec5e commit 23c7528
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions fix-role.cf.template
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ Resources:
WorkspaceId: !Ref WorkspaceId
ExternalId: !Ref ExternalId
FixEnvironment: "{{environment}}"
FixStackVersion: "{{unixtime}}"
ServiceToken: !Sub "arn:aws:sns:${AWS::Region}:{{fix_account_id}}:FixAccountCallbacks"
9 changes: 6 additions & 3 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ fi

template_files=("fix-role.cf.template")
environments=("dev" "global")
unixtime=$(date +%s)
iso8601=$(date -d @"$unixtime" --iso-8601=seconds)

echo "Generating stack_version.json"
echo "{\"date\": \"$iso8601\", \"unixtime\": $unixtime}" | jq > "$temp_dir/stack_version.json"

for template_file in "${template_files[@]}"; do
output_prefix="${template_file%%.*}"
Expand All @@ -30,10 +35,8 @@ for template_file in "${template_files[@]}"; do
echo "Generating $output_file"
sed -e "s/{{environment}}/${env}/g" \
-e "s/{{fix_account_id}}/${fix_account_id}/g" \
-e "s/{{unixtime}}/${unixtime}/g" \
-e "s#{{callback_url}}#${callback_url}#g" \
"$template_file" > "$output_file"
done
done

# temporary workaround
cp "$temp_dir/fix-role-dev.yaml" "$temp_dir/fix-role-dev-eu.yaml"

0 comments on commit 23c7528

Please sign in to comment.