Skip to content

Commit

Permalink
try #4
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkermichael committed Oct 14, 2022
1 parent a1f88da commit 4755326
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions control-plane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,17 @@ endif
# In Github Actions, the linux binary will be attached from a previous step at pkg/bin/linux_amd64/. This make target
# should only run in CI and not locally.
ci.dev-docker-github:
@echo "Pulling consul-k8s container image - $(CONSUL_K8S_IMAGE_VERSION)"
@docker pull hashicorp/consul-k8s:$(CONSUL_K8S_IMAGE_VERSION) >/dev/null #todo change this back after pulling it the first time since the dockerfile is FROM this image
@echo "Building consul-k8s Development container - $(CI_DEV_DOCKER_IMAGE_NAME)"
@docker build -t '$(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT)' \
--build-arg CONSUL_K8S_IMAGE_VERSION=$(CONSUL_K8S_IMAGE_VERSION) \
--label COMMIT_SHA=$(GITHUB_SHA) \
--label PULL_REQUEST=$(GITHIB_PULL_REQUEST) \
--label GITHUB_BUILD_URL=$(GITHUB_SERVER_URL)/$(GITHUB_REPOSITORY)/actions/runs/$(GITHUB_RUN_ID) \
$(CI_DEV_DOCKER_WORKDIR) -f $(CURDIR)/build-support/docker/Dev.dockerfile
@echo $(DOCKER_PASS) | docker login -u="$(DOCKER_USER)" --password-stdin
@echo "Pushing dev image to: https://cloud.docker.com/u/$(CI_DEV_DOCKER_NAMESPACE)/repository/docker/$(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME)"
@docker push $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT)
@docker buildx build -t '$(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT)' \
--platform linux/amd64,linux/arm64 \
--target=dev \
--push \
--label COMMIT_SHA=$(CIRCLE_SHA1) \
--label PULL_REQUEST=$(CIRCLE_PULL_REQUEST) \
--label CIRCLE_BUILD_URL=$(CIRCLE_BUILD_URL) \
$(CI_DEV_DOCKER_WORKDIR) -f $(CURDIR)/Dockerfile
@echo "Pushed dev image to: $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT)"
ifeq ($(GITHUB_REF_NAME), main)
@docker tag $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT) $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):latest
@docker push $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):latest
Expand Down

0 comments on commit 4755326

Please sign in to comment.