Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
BIN_DIR := bin

# Binaries.
KUSTOMIZE := $(TOOLS_BIN_DIR)/kustomize
CLUSTERCTL := $(BIN_DIR)/clusterctl
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
Expand All @@ -59,7 +60,6 @@ RBAC_ROOT ?= $(MANIFEST_ROOT)/rbac

# Check if binaries exist
HAS_YQ := $(shell command -v yq;)
HAS_KUSTOMIZE := $(shell command -v kustomize;)
HAS_ENVSUBST := $(shell command -v envsubst;)

## --------------------------------------
Expand Down Expand Up @@ -97,23 +97,19 @@ test-go: ## Run golang tests
# See:
# * https://github.com/mikefarah/yq/issues/291
# * https://github.com/mikefarah/yq/issues/289
test-generate-examples:
test-generate-examples: $(KUSTOMIZE)
ifndef HAS_YQ
echo "installing yq"
GO111MODULE=on go get -u github.com/mikefarah/yq@d05391e
endif
ifndef HAS_KUSTOMIZE
echo "installing kustomize"
GO111MODULE=off go get sigs.k8s.io/kustomize/kustomize
endif
ifndef HAS_ENVSUBST
echo "installing envsubst"
go get github.com/a8m/envsubst/cmd/envsubst
endif
# Create a dummy file for test only
mkdir -p tmp/dummy-make-auto-test
echo 'clouds' > tmp/dummy-make-auto-test/dummy-clouds-test.yaml
examples/generate.sh -f tmp/dummy-make-auto-test/dummy-clouds-test.yaml openstack tmp/dummy-make-auto-test/_out
PATH=$(TOOLS_DIR)/$(BIN_DIR):${PATH} examples/generate.sh -f tmp/dummy-make-auto-test/dummy-clouds-test.yaml openstack tmp/dummy-make-auto-test/_out
# the folder will be generated under same folder of examples
rm -rf tmp/dummy-make-auto-test

Expand All @@ -132,6 +128,9 @@ manager: ## Build manager binary.
## Tooling Binaries
## --------------------------------------

$(KUSTOMIZE): $(TOOLS_DIR)/go.mod # Build kustomize from tools folder.
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/kustomize sigs.k8s.io/kustomize/kustomize/v3

$(CLUSTERCTL): go.mod ## Build clusterctl binary.
go build -o $(BIN_DIR)/clusterctl sigs.k8s.io/cluster-api/cmd/clusterctl

Expand Down Expand Up @@ -264,7 +263,7 @@ release-manifests: $(RELEASE_DIR) ## Builds the manifests to publish with a rele
MANIFEST_IMG=$(PROD_REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(RELEASE_TAG) \
$(MAKE) set-manifest-image
PULL_POLICY=IfNotPresent $(MAKE) set-manifest-pull-policy
kustomize build config/default > $(RELEASE_DIR)/infrastructure-components.yaml
$(KUSTOMIZE) build config/default > $(RELEASE_DIR)/infrastructure-components.yaml

.PHONY: release-staging
release-staging: ## Builds and push container images to the staging bucket.
Expand Down
7 changes: 6 additions & 1 deletion hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ go 1.12

require (
github.com/golang/mock v1.3.1
github.com/golangci/golangci-lint v1.17.1
github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 // indirect
github.com/golangci/golangci-lint v1.19.1
github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
sigs.k8s.io/controller-tools v0.2.0
sigs.k8s.io/kustomize/kustomize/v3 v3.4.0
sigs.k8s.io/testing_frameworks v0.1.1
)

Expand Down
Loading