-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: implement env subst (#200)
* chore: rename orb variables using orb standards * refactor: implement circleci env subst * chore: update parameter name * chore: update src/scripts/deploy_ecs_scheduled_task.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/deploy_ecs_scheduled_task.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/get_prev_task.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/get_prev_task.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/get_prev_task.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/run_task.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/run_task.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/update_bluegreen_service_via_task_def.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/update_service_via_task_def.sh Co-authored-by: Eric Ribeiro <[email protected]> * chore: update src/scripts/verify_revision_is_deployed.sh Co-authored-by: Eric Ribeiro <[email protected]> * refactor: remove global shellcheck exclusions * fix: address shell check errors * chore: update provider version --------- Co-authored-by: Eric Ribeiro <[email protected]>
- Loading branch information
1 parent
59cea45
commit 9a7f618
Showing
29 changed files
with
233 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
#!/bin/bash | ||
td_arn=$CCI_ORB_AWS_ECS_REGISTERED_TASK_DFN | ||
|
||
if [ -z "$td_arn" ]; then | ||
echo "Updated task definition not found. Please run update-task-definition command before deploy-ecs-scheduled-task" | ||
exit 1 | ||
fi | ||
|
||
ORB_EVAL_RULE_NAME="$(circleci env subst "${ORB_EVAL_RULE_NAME}")" | ||
|
||
CLI_OUTPUT_FILE=$(mktemp cli-output.json.XXXX) | ||
CLI_INPUT_FILE=$(mktemp cli-input.json.XXXX) | ||
|
||
aws events list-targets-by-rule --rule "$ECS_PARAM_RULE_NAME" --output json > "$CLI_OUTPUT_FILE" | ||
aws events list-targets-by-rule --rule "$ORB_EVAL_RULE_NAME" --output json > "$CLI_OUTPUT_FILE" | ||
|
||
if < "$CLI_OUTPUT_FILE" jq ' .Targets[] | has("EcsParameters")' | grep "false"; then | ||
echo "Invalid ECS Rule. $ECS_PARAM_RULE_NAME does not contain EcsParameters key. Please create a valid ECS Rule and try again" | ||
echo "Invalid ECS Rule. $ORB_EVAL_RULE_NAME does not contain EcsParameters key. Please create a valid ECS Rule and try again" | ||
exit 1 | ||
fi | ||
|
||
< "$CLI_OUTPUT_FILE" jq --arg td_arn "$td_arn" '.Targets[].EcsParameters.TaskDefinitionArn |= $td_arn' > "$CLI_INPUT_FILE" | ||
aws events put-targets --rule $ECS_PARAM_RULE_NAME --cli-input-json "$(cat "$CLI_INPUT_FILE")" | ||
aws events put-targets --rule "$ORB_EVAL_RULE_NAME" --cli-input-json "$(cat "$CLI_INPUT_FILE")" |
Oops, something went wrong.