-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go module rename to stolostron for release-2.2 (#126)
Signed-off-by: Xiangjing Li <[email protected]>
- Loading branch information
1 parent
c1039a8
commit 4218674
Showing
23 changed files
with
76 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,7 @@ TRAVIS_BUILD ?= 1 | |
# Image URL to use all building/pushing image targets; | ||
# Use your own docker registry and image name for dev/test by overridding the IMG and REGISTRY environment variable. | ||
IMG ?= $(shell cat COMPONENT_NAME 2> /dev/null) | ||
REGISTRY ?= quay.io/open-cluster-management | ||
|
||
# Github host to use for checking the source tree; | ||
# Override this variable ue with your own value if you're working on forked repo. | ||
GIT_HOST ?= github.com/open-cluster-management | ||
REGISTRY ?= quay.io/stolostron | ||
|
||
PWD := $(shell pwd) | ||
BASE_DIR := $(shell basename $(PWD)) | ||
|
@@ -35,7 +31,6 @@ GOBIN_DEFAULT := $(GOPATH)/bin | |
export GOBIN ?= $(GOBIN_DEFAULT) | ||
TESTARGS_DEFAULT := "-v" | ||
export TESTARGS ?= $(TESTARGS_DEFAULT) | ||
DEST ?= $(GOPATH)/src/$(GIT_HOST)/$(BASE_DIR) | ||
VERSION ?= $(shell cat COMPONENT_VERSION 2> /dev/null) | ||
IMAGE_NAME_AND_VERSION ?= $(REGISTRY)/$(IMG) | ||
|
||
|
@@ -51,17 +46,21 @@ else | |
$(error "This system's OS $(LOCAL_OS) isn't recognized/supported") | ||
endif | ||
|
||
.PHONY: fmt lint test coverage build build-images | ||
TEST_TMP :=/tmp | ||
export KUBEBUILDER_ASSETS ?=$(TEST_TMP)/kubebuilder/bin | ||
K8S_VERSION ?=1.19.2 | ||
GOHOSTOS ?=$(shell go env GOHOSTOS) | ||
GOHOSTARCH ?= $(shell go env GOHOSTARCH) | ||
KB_TOOLS_ARCHIVE_NAME :=kubebuilder-tools-$(K8S_VERSION)-$(GOHOSTOS)-$(GOHOSTARCH).tar.gz | ||
KB_TOOLS_ARCHIVE_PATH := $(TEST_TMP)/$(KB_TOOLS_ARCHIVE_NAME) | ||
|
||
ifneq ("$(realpath $(DEST))", "$(realpath $(PWD))") | ||
$(error Please run 'make' from $(DEST). Current directory is $(PWD)) | ||
endif | ||
.PHONY: fmt lint test coverage build build-images | ||
|
||
# GITHUB_USER containing '@' char must be escaped with '%40' | ||
GITHUB_USER := $(shell echo $(GITHUB_USER) | sed 's/@/%40/g') | ||
GITHUB_TOKEN ?= | ||
|
||
GOPRIVATE := github.com/open-cluster-management | ||
GOPRIVATE := github.com/stolostron | ||
|
||
ifdef GITHUB_TOKEN | ||
$(shell git config --global url."https://$(GITHUB_TOKEN):[email protected]/".insteadOf "https://github.com/") | ||
|
@@ -71,7 +70,7 @@ USE_VENDORIZED_BUILD_HARNESS ?= | |
|
||
ifndef USE_VENDORIZED_BUILD_HARNESS | ||
ifeq ($(TRAVIS_BUILD),1) | ||
-include $(shell curl -H 'Authorization: token ${GITHUB_TOKEN}' -H 'Accept: application/vnd.github.v4.raw' -L https://api.github.com/repos/open-cluster-management/build-harness-extensions/contents/templates/Makefile.build-harness-bootstrap -o .build-harness-bootstrap; echo .build-harness-bootstrap) | ||
-include $(shell curl -H 'Authorization: token ${GITHUB_TOKEN}' -H 'Accept: application/vnd.github.v4.raw' -L https://api.github.com/repos/stolostron/build-harness-extensions/contents/templates/Makefile.build-harness-bootstrap -o .build-harness-bootstrap; echo .build-harness-bootstrap) | ||
endif | ||
else | ||
-include vbh/.build-harness-vendorized | ||
|
@@ -115,8 +114,23 @@ lint: lint-all | |
# test section | ||
############################################################ | ||
|
||
test: | ||
go test -coverprofile=coverage.out ./... | ||
.PHONY: ensure-kubebuilder-tools | ||
|
||
# download the kubebuilder-tools to get kube-apiserver binaries from it | ||
ensure-kubebuilder-tools: | ||
ifeq "" "$(wildcard $(KUBEBUILDER_ASSETS))" | ||
$(info Downloading kube-apiserver into '$(KUBEBUILDER_ASSETS)') | ||
mkdir -p '$(KUBEBUILDER_ASSETS)' | ||
curl -s -f -L https://storage.googleapis.com/kubebuilder-tools/$(KB_TOOLS_ARCHIVE_NAME) -o '$(KB_TOOLS_ARCHIVE_PATH)' | ||
tar -C '$(KUBEBUILDER_ASSETS)' --strip-components=2 -zvxf '$(KB_TOOLS_ARCHIVE_PATH)' | ||
else | ||
$(info Using existing kube-apiserver from "$(KUBEBUILDER_ASSETS)") | ||
endif | ||
|
||
.PHONY: test | ||
|
||
test: ensure-kubebuilder-tools | ||
go test -timeout 300s -v ./pkg/... | ||
|
||
############################################################ | ||
# coverage section | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.