Skip to content

fix(cli): use image digest instead of commit id when deploying #2196

Merged
mergify[bot] merged 5 commits intoaws:mainlinefrom
efekarakus:deploy-no-tag
Apr 26, 2021
Merged

fix(cli): use image digest instead of commit id when deploying #2196
mergify[bot] merged 5 commits intoaws:mainlinefrom
efekarakus:deploy-no-tag

Conversation

@efekarakus
Copy link
Copy Markdown
Contributor

Fixes #2139

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@efekarakus efekarakus requested a review from a team as a code owner April 20, 2021 23:19
@efekarakus efekarakus changed the title @efekarakus fix(cli): use image digest instead of commit id when deploying fix(cli): use image digest instead of commit id when deploying Apr 20, 2021
Copy link
Copy Markdown
Contributor

@Lou1415926 Lou1415926 left a comment

Choose a reason for hiding this comment

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

The code LGTM!!


// GetLocation returns the location of the ECR image.
// GetLocation returns the ECR image URI.
// If a tag is provided for the image than prioritize refering to the image via the tag.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
// If a tag is provided for the image than prioritize refering to the image via the tag.
// If a tag is provided for the image then prioritize refering to the image via the tag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment thread internal/pkg/cli/job_deploy.go Outdated
return err
}
o.imageTag = tag
o.imageTag = imageTagFromGit(o.cmd, o.imageTag)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be moved to, for example, Execute() since we are no longer asking for it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That makes sense! I've done this, I'll send a follow-up PR to move git.go inside the exec pkg. So that we have one package for running any commands, and increase our unit test coverage by moving it outside of the cli pkg.

Comment thread internal/pkg/cli/svc_package_test.go Outdated
wantedErrorS string
}{
"prompt for all options": {
"sets the image tag if not in a git repository": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"sets the image tag if not in a git repository": {
"leaves the image tag empty if not in a git repository": {

Copy link
Copy Markdown
Contributor

@iamhopaul123 iamhopaul123 left a comment

Choose a reason for hiding this comment

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

+1 to wanxian's feedback otherwise looks good to me!

// GetLocation returns the ECR image URI.
// If a tag is provided for the image than prioritize refering to the image via the tag.
// If a digest is present then refer to the image via the digest.
// Otherwise, use the "latest" tag.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe be more specific about it: currently the only use case is when doing package command with the default tag.

Copy link
Copy Markdown
Contributor

@Lou1415926 Lou1415926 left a comment

Choose a reason for hiding this comment

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

Looks good!

@mergify mergify Bot merged commit 80abe4b into aws:mainline Apr 26, 2021
@efekarakus efekarakus deleted the deploy-no-tag branch April 26, 2021 17:43
thrau pushed a commit to localstack/copilot-cli-local that referenced this pull request Dec 9, 2022
)

Fixes aws#2139

_By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support deploying without creating a git commit

4 participants