diff --git a/Makefile b/Makefile index bf016f1da8..b334ec6f02 100644 --- a/Makefile +++ b/Makefile @@ -98,17 +98,25 @@ test: generate ## Run tests copy-genmocks: test ## Copies generated mocks into the repository cp -Rf bazel-genfiles/pkg/* pkg/ +BAZEL_DOCKER_ARGS_COMMON := --define=MANAGER_IMAGE_NAME=$(MANAGER_IMAGE_NAME) --define=MANAGER_IMAGE_TAG=$(MANAGER_IMAGE_TAG) $(BAZEL_ARGS) +BAZEL_DOCKER_ARGS := --define=DOCKER_REPO=$(STABLE_DOCKER_REPO) $(BAZEL_DOCKER_ARGS_COMMON) +BAZEL_DOCKER_ARGS_DEV := --define=DOCKER_REPO=$(DEV_DOCKER_REPO) $(BAZEL_DOCKER_ARGS_COMMON) + .PHONY: docker-build -docker-build: generate ## Build the docker image - bazel build //cmd/manager $(BAZEL_ARGS) +docker-build: generate ## Build the production docker image + bazel run //cmd/manager:manager-image $(BAZEL_DOCKER_ARGS) + +.PHONY: docker-build-dev +docker-build-dev: generate ## Build the development docker image + bazel run //cmd/manager:manager-image $(BAZEL_DOCKER_ARGS_DEV) .PHONY: docker-push docker-push: generate ## Push production docker image - bazel run //cmd/manager:manager-push --define=DOCKER_REPO=$(STABLE_DOCKER_REPO) --define=MANAGER_IMAGE_NAME=$(MANAGER_IMAGE_NAME) --define=MANAGER_IMAGE_TAG=$(MANAGER_IMAGE_TAG) $(BAZEL_ARGS) + bazel run //cmd/manager:manager-push $(BAZEL_DOCKER_ARGS) .PHONY: docker-push-dev docker-push-dev: generate ## Push development image - bazel run //cmd/manager:manager-push --define=DOCKER_REPO=$(DEV_DOCKER_REPO) --define=MANAGER_IMAGE_NAME=$(MANAGER_IMAGE_NAME) --define=MANAGER_IMAGE_TAG=$(MANAGER_IMAGE_TAG) $(BAZEL_ARGS) + bazel run //cmd/manager:manager-push $(BAZEL_DOCKER_ARGS_DEV) .PHONY: clean clean: ## Remove all generated files diff --git a/docs/development.md b/docs/development.md index 94914621a4..838c84ecce 100644 --- a/docs/development.md +++ b/docs/development.md @@ -8,9 +8,9 @@ - [Committing code](#committing-code) - [Mocks](#mocks) - [Set up](#set-up) - - [Base requirements](#base-requirements) - - [Using Google Cloud](#using-google-cloud) - - [Using images on Google Cloud](#using-images-on-google-cloud) + - [Base requirements](#base-requirements) + - [Using Google Cloud](#using-google-cloud) + - [Using images on Google Cloud](#using-images-on-google-cloud) - [cluster-api-dev-helper](#cluster-api-dev-helper) @@ -46,7 +46,8 @@ required for the provider manifests. 3. Install [minikube][minikube] - `brew install minikube` on MacOS. 4. Install [bazel][bazel] -5. Configure `minikube`: +5. Configure Python 2.7+ with [pyenv][pyenv] if your default is Python 3.x. +6. Configure `minikube`: 1. Use Kubernetes v1.12.1 `minikube config set kubernetes-version v1.12.1`. 2. Use kubeadm as bootstrapper `minikube config set bootstrapper kubeadm`. @@ -91,3 +92,4 @@ make cluster-api-dev-helper [minikube]: https://kubernetes.io/docs/setup/minikube/ [aws_cli]: https://docs.aws.amazon.com/cli/latest/userguide/installing.html [bazel]: https://docs.bazel.build/versions/master/install.html +[pyenv]: https://github.com/pyenv/pyenv