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

block pushes on non-clean git repos #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

drewwells
Copy link
Contributor

No description provided.

@@ -78,7 +78,9 @@ push-atlas: docker
ifndef IMAGE_REGISTRY
@(echo "Please set IMAGE_REGISTRY variable in Makefile.vars to use push command"; exit 1)
else
@docker push $(SERVER_IMAGE):$(IMAGE_VERSION)
# Verify no changes locally prior to pushing image
git diff --exit-code
Copy link
Contributor

Choose a reason for hiding this comment

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

This might not work as expected, because the flag file could be stale. The way this makefile was implemented doesn't check for a stale docker build context like basic docker build does.

If this section is removed, docker will ensure the image is based on the current context, which in turn will make the output of git diff --exit-code useful for matching the image to the commit.

.docker-$(IMAGE_NAME)-$(IMAGE_VERSION):
$(MAKE) docker-atlas
touch $@
.PHONY: docker
docker: .docker-$(IMAGE_NAME)-$(IMAGE_VERSION)

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.

2 participants