|
| 1 | +#This makefile is used by ci-operator |
| 2 | + |
| 3 | +# Copyright 2019 The OpenShift Knative Authors |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +CGO_ENABLED=1 |
| 18 | +GOOS ?= |
| 19 | +GOARCH ?= |
| 20 | +TEST_IMAGES=./test/test_images/helloworld knative.dev/serving/test/test_images/grpc-ping knative.dev/serving/test/test_images/multicontainer/servingcontainer knative.dev/serving/test/test_images/multicontainer/sidecarcontainer |
| 21 | +TEST= |
| 22 | +TEST_IMAGE_TAG ?= latest |
| 23 | + |
| 24 | +install: build |
| 25 | + cp ./kn $(GOPATH)/bin |
| 26 | +.PHONY: install |
| 27 | + |
| 28 | +build: |
| 29 | + GOFLAGS='' ./hack/build.sh -f |
| 30 | +.PHONY: build |
| 31 | + |
| 32 | +build-with-platform: |
| 33 | + ./hack/build.sh -p $(GOOS) $(GOARCH) |
| 34 | +.PHONY: build-with-platform |
| 35 | + |
| 36 | +build-cross: |
| 37 | + GOFLAGS='' ./hack/build.sh -x |
| 38 | +.PHONY: build-cross |
| 39 | + |
| 40 | +build-cross-package: build-cross |
| 41 | + GOFLAGS='' ./package_cliartifacts.sh |
| 42 | +.PHONY: build-cross-package |
| 43 | + |
| 44 | +test-install: |
| 45 | + GOFLAGS='' go install $(TEST_IMAGES) |
| 46 | +.PHONY: test-install |
| 47 | + |
| 48 | +test-images: |
| 49 | + for img in $(TEST_IMAGES); do \ |
| 50 | + KO_DOCKER_REPO=$(DOCKER_REPO_OVERRIDE) ko build --tags=$(TEST_IMAGE_TAG) $(KO_FLAGS) -B $$img ; \ |
| 51 | + done |
| 52 | +.PHONY: test-images |
| 53 | + |
| 54 | +test-unit: |
| 55 | + GOFLAGS='' ./hack/build.sh -t |
| 56 | +.PHONY: test-unit |
| 57 | + |
| 58 | +test-e2e: |
| 59 | + GOFLAGS='' ./openshift/e2e-tests-openshift.sh |
| 60 | +.PHONY: test-e2e |
| 61 | + |
| 62 | +# Run make DOCKER_REPO_OVERRIDE=<your_repo> test-e2e-local if test images are available |
| 63 | +# in the given repository. Make sure you first build and push them there by running `make test-images`. |
| 64 | +# Run make BRANCH=<ci_promotion_name> test-e2e-local if test images from the latest CI |
| 65 | +# build for this branch should be used. Example: `make BRANCH=knative-v0.17.2 test-e2e-local`. |
| 66 | +# If neither DOCKER_REPO_OVERRIDE nor BRANCH are defined the tests will use test images |
| 67 | +# from the last nightly build. |
| 68 | +# If TEST is defined then only the single test will be run. |
| 69 | +test-e2e-local: |
| 70 | + ./openshift/e2e-tests-local.sh $(TEST) |
| 71 | +.PHONY: test-e2e-local |
| 72 | + |
| 73 | +# Generate an aggregated knative release yaml file, as well as a CI file with replaced image references |
| 74 | +generate-release: |
| 75 | + ./openshift/generate.sh |
| 76 | +.PHONY: generate-release |
0 commit comments