Skip to content

Commit

Permalink
feat: add profile support
Browse files Browse the repository at this point in the history
  • Loading branch information
Menachem Hornbacher authored Aug 17, 2022
1 parent 7cbaffa commit 689f762
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Retries login after a delay N times. Defaults to 0.

Assume an AWS IAM role before ECR login. Supports `role-arn` and `duration-seconds` (optional) per the [associated AWS CLI command.](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sts/assume-role.html)

### `profile` (optional)

Use a different AWS profile from the default during ECR login.

## License

MIT (see [LICENSE](LICENSE))
4 changes: 4 additions & 0 deletions hooks/environment
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ function login_using_aws_ecr_get_login() {
login_args+=("--region" "${BUILDKITE_PLUGIN_ECR_REGION}")
fi

if [[ -n "${BUILDKITE_PLUGIN_ECR_PROFILE:-}" ]] ; then
login_args+=("--profile" "${BUILDKITE_PLUGIN_ECR_PROFILE}")
fi

if [[ ${#registry_ids[@]} -gt 0 ]] ; then
# amend the ~~~ log heading with ^^^ to add the AWS account IDs
echo "^^^ Authenticating with AWS ECR for ${registry_ids[*]} :ecr: :docker:"
Expand Down
2 changes: 2 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ configuration:
duration-seconds:
type: number
default: 3600
profile:
type: string
required:
- login

0 comments on commit 689f762

Please sign in to comment.