-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add docker-push-latest rule #47
Conversation
Makefile.main
Outdated
@@ -115,6 +115,40 @@ docker-push: | |||
echo "Successfully uploaded image."; \ | |||
done; \ | |||
|
|||
# this rule must be run only after tagged image was created by `docker-push` | |||
docker-push-latest: | |||
@if [ "$(BRANCH)" == "master" ]; then \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this to a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call! thanks! fixed!
Makefile.main
Outdated
@@ -115,6 +98,25 @@ docker-push: | |||
echo "Successfully uploaded image."; \ | |||
done; \ | |||
|
|||
# this rule must be run only after tagged image was created by `docker-push` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then fail if the current image wasn't tagged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will fail during docker tag
. With error like:
Error response from daemon: No such image: bla:v1
Can't tag image.
then script stops and doesn't try to upload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this new rule should depend on the original :docker-push
; that way, the dependency of the previous one will be programmatically ensured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea! Thanks! Fixed.
Makefile.main
Outdated
@@ -115,6 +98,25 @@ docker-push: | |||
echo "Successfully uploaded image."; \ | |||
done; \ | |||
|
|||
# this rule must be run only after tagged image was created by `docker-push` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this new rule should depend on the original :docker-push
; that way, the dependency of the previous one will be programmatically ensured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Only one thing. I don't know pretty well about what the .PHONY
is, but I think it should include the new docker-push-latest
target, shouln't it?
Anyhow, I think it shouldn't block the PR.
Signed-off-by: Maxim Sukharev <maxim@sourced.tech>
Oh! Thanks! According to documentation make will associate Makefile targets with files first. So if we occasionally create file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be strange to create a file with that name, but yes, let's avoid errors.
All comments are addressed. Does it look fine for you now @mcuadros ? |
Same as #44 but separate rule