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

Make circle aws deploy commands idempotent #57

Merged
merged 3 commits into from
Jul 16, 2019
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ commands:
- run:
name: Configure AWS
command: |
mkdir ~/.aws
mkdir -p ~/.aws
cp .circleci/aws_config ~/.aws/config
echo -e $AWS_PROD_PROFILE >> ~/.aws/config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this now be slightly non-idempotent? I guess it's fine to have "$AWS_PROD_PROFILE" a bunch of times at the end of the aws config?

it does make me wonder if there is some way to refactor the config such that the "configure aws" step just gets run once, rather than trying to make it safe to run a bunch of times. is it even really necessary to use the aws/config thing? can those options just be passed directly to the s3 copy command? eg, adding "--output json" to the arguments, and same for whatever AWS_PROD_PROFILE contains (it could be split up into a few variables as needed?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yea fixed. I think the config thing protects some config magic but I can revisit later. Also hoping to use redirects in the future instead of this double copy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(actually the file gets overwritten in the cp step previous)

- aws-s3/copy:
Expand Down