-
Notifications
You must be signed in to change notification settings - Fork 237
Simplify and improve the local developer experience for pushing images #167
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,19 +18,16 @@ ifdef WERCKER | |
| TENANT := "oracle" | ||
| else | ||
| NEW_NAMESPACE ?= e2e-${USER} | ||
| VERSION := ${USER}-$(shell date +%Y%m%d%H%M%S) | ||
| VERSION := ${USER}-$(shell git describe --always --dirty) | ||
|
||
| TENANT := "spinnaker" | ||
|
||
| endif | ||
|
|
||
| ROOT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
| PKG := github.com/oracle/mysql-operator | ||
| REGISTRY := iad.ocir.io/$(TENANT) | ||
| REGISTRY := iad.ocir.io | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
| SRC_DIRS := cmd pkg test/examples | ||
| REGISTRY_STRING := $(subst /,_,$(REGISTRY)) | ||
| CMD_DIRECTORIES := $(sort $(dir $(wildcard ./cmd/*/))) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer used |
||
| COMMANDS := $(CMD_DIRECTORIES:./cmd/%/=%) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer used
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still used / referenced. Will remove in a subsequent PR when fixing the build step to keep things clean. |
||
| CONTAINER_FILES := $(addprefix .container-$(REGISTRY_STRING)-,$(addsuffix -$(VERSION),$(COMMANDS))) | ||
| PUSH_FILES := $(addprefix .push-$(REGISTRY_STRING)-,$(addsuffix -$(VERSION),$(COMMANDS))) | ||
|
|
||
| ARCH := amd64 | ||
|
||
| OS := linux | ||
|
||
|
|
@@ -75,23 +72,15 @@ build: dist build-dirs Makefile | |
| ARCH=$(ARCH) OS=$(OS) VERSION=$(VERSION) PKG=$(PKG) ./hack/build.sh | ||
| cp $(BINARIES) ./bin/$(OS)_$(ARCH)/ | ||
|
|
||
| # Note: Only used for development, i.e. in CI the images are built using Wercker. | ||
| .PHONY: containers | ||
| containers: $(CONTAINER_FILES) | ||
| .container-$(REGISTRY_STRING)-%-$(VERSION): build dist | ||
| @echo Builing container: $* | ||
| @docker login -u '$(DOCKER_REGISTRY_USERNAME)' -p '$(DOCKER_REGISTRY_PASSWORD)' $(REGISTRY) | ||
| @docker build --build-arg=http_proxy --build-arg=https_proxy -t $(REGISTRY)/$*:$(VERSION) -f docker/$*/Dockerfile . | ||
| @docker images -q $(REGISTRY)/$*:$(VERSION) > $@ | ||
|
|
||
| # Note: Only used for development, i.e. in CI the images are pushed using Wercker. | ||
| .PHONY: push | ||
| push: $(PUSH_FILES) | ||
| .push-$(REGISTRY_STRING)-%-$(VERSION): .container-$(REGISTRY_STRING)-%-$(VERSION) | ||
| @echo Pushing container: $* | ||
| @docker login -u '$(DOCKER_REGISTRY_USERNAME)' -p '$(DOCKER_REGISTRY_PASSWORD)' $(REGISTRY) | ||
| @docker push $(REGISTRY)/$*:$(VERSION) | ||
| @docker images -q $(REGISTRY)/$*:$(VERSION) > $@ | ||
| push: build | ||
| @docker build --build-arg=http_proxy --build-arg=https_proxy -t $(REGISTRY)/$(TENANT)/mysql-operator:$(VERSION) -f docker/mysql-operator/Dockerfile . | ||
|
||
| @docker build --build-arg=http_proxy --build-arg=https_proxy -t $(REGISTRY)/$(TENANT)/mysql-agent:$(VERSION) -f docker/mysql-agent/Dockerfile . | ||
|
|
||
| @docker login iad.ocir.io -u $(DOCKER_REGISTRY_USERNAME) -p '$(DOCKER_REGISTRY_PASSWORD)' | ||
| @docker push $(REGISTRY)/$(TENANT)/mysql-operator:$(VERSION) | ||
| @docker push $(REGISTRY)/$(TENANT)/mysql-agent:$(VERSION) | ||
|
|
||
| .PHONY: version | ||
| version: | ||
|
|
@@ -102,14 +91,7 @@ lint: | |
| @find pkg cmd -name '*.go' | grep -v 'generated' | xargs -L 1 golint | ||
|
|
||
| .PHONY: clean | ||
| clean: container-clean bin-clean | ||
|
|
||
| .PHONY: container-clean | ||
| container-clean: | ||
| rm -rf .container-* .push-* dist | ||
|
|
||
| .PHONY: bin-clean | ||
| bin-clean: | ||
| clean: | ||
| rm -rf .go bin | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to rm
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still created on my machine. Will remove after fixing the build process in a subsequent PR. |
||
|
|
||
| .PHONY: run-dev | ||
|
|
||
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.
No longer used