diff --git a/.github/bin/minishift/test-operator-update.sh b/.github/bin/minishift/test-operator-update.sh index abb67418a..e80e4bd31 100755 --- a/.github/bin/minishift/test-operator-update.sh +++ b/.github/bin/minishift/test-operator-update.sh @@ -15,6 +15,10 @@ set -x # Get absolute path for root repo directory from github actions context: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions export OPERATOR_REPO="${GITHUB_WORKSPACE}" +if [ -z "${OPERATOR_REPO}" ]; then + SCRIPT=$(readlink -f "${BASH_SOURCE[0]}") + OPERATOR_REPO=$(dirname "$(dirname "$(dirname "$(dirname "$SCRIPT")")")") +fi source "${OPERATOR_REPO}"/.github/bin/common.sh # Stop execution on any error diff --git a/Dockerfile b/Dockerfile index 5381a381f..4f7cf95e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN curl -sSLo /tmp/asset-devworkspace-operator.zip https://api.github.com/repos # build operator RUN export ARCH="$(uname -m)" && if [[ ${ARCH} == "x86_64" ]]; then export ARCH="amd64"; elif [[ ${ARCH} == "aarch64" ]]; then export ARCH="arm64"; fi && \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o che-operator main.go + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod=vendor -a -o che-operator main.go RUN unzip /tmp/asset-devworkspace-operator.zip */deploy/deployment/* -d /tmp && \ mkdir -p /tmp/devworkspace-operator/templates/ && \ diff --git a/Makefile b/Makefile index da1908606..5a9e06353 100644 --- a/Makefile +++ b/Makefile @@ -262,7 +262,7 @@ ENVTEST_ASSETS_DIR=$(shell pwd)/testbin test: manifests generate fmt vet ## Run tests. mkdir -p ${ENVTEST_ASSETS_DIR} test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.6.3/hack/setup-envtest.sh - source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out + source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test -mod=vendor ./... -coverprofile cover.out ##@ Build @@ -821,7 +821,9 @@ bundle-build: ## Build the bundle image. fi BUNDLE_PACKAGE="eclipse-che-preview-$(platform)" BUNDLE_DIR="bundle/$(DEFAULT_CHANNEL)/$${BUNDLE_PACKAGE}" - docker build -f $${BUNDLE_DIR}/bundle.Dockerfile -t $(BUNDLE_IMG) . + cd $${BUNDLE_DIR} + docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) . + cd ../../.. .PHONY: bundle-push bundle-push: ## Push the bundle image. diff --git a/bundle/nightly/eclipse-che-preview-kubernetes/bundle.Dockerfile b/bundle/nightly/eclipse-che-preview-kubernetes/bundle.Dockerfile index d8df8c0ab..09c4af346 100644 --- a/bundle/nightly/eclipse-che-preview-kubernetes/bundle.Dockerfile +++ b/bundle/nightly/eclipse-che-preview-kubernetes/bundle.Dockerfile @@ -16,6 +16,6 @@ LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ # Copy files to locations specified by labels. -COPY bundle/nightly/eclipse-che-preview-kubernetes/manifests /manifests/ -COPY bundle/nightly/eclipse-che-preview-kubernetes/metadata /metadata/ -COPY bundle/nightly/eclipse-che-preview-kubernetes/tests/scorecard /tests/scorecard/ +COPY manifests /manifests/ +COPY metadata /metadata/ +COPY tests/scorecard /tests/scorecard/ diff --git a/bundle/nightly/eclipse-che-preview-openshift/bundle.Dockerfile b/bundle/nightly/eclipse-che-preview-openshift/bundle.Dockerfile index 43037e8b2..f28895cba 100644 --- a/bundle/nightly/eclipse-che-preview-openshift/bundle.Dockerfile +++ b/bundle/nightly/eclipse-che-preview-openshift/bundle.Dockerfile @@ -16,6 +16,6 @@ LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ # Copy files to locations specified by labels. -COPY bundle/nightly/eclipse-che-preview-openshift/manifests /manifests/ -COPY bundle/nightly/eclipse-che-preview-openshift/metadata /metadata/ -COPY bundle/nightly/eclipse-che-preview-openshift/tests/scorecard /tests/scorecard/ +COPY manifests /manifests/ +COPY metadata /metadata/ +COPY tests/scorecard /tests/scorecard/ diff --git a/bundle/stable/eclipse-che-preview-kubernetes/bundle.Dockerfile b/bundle/stable/eclipse-che-preview-kubernetes/bundle.Dockerfile index 71a1c7ef6..da86419ea 100644 --- a/bundle/stable/eclipse-che-preview-kubernetes/bundle.Dockerfile +++ b/bundle/stable/eclipse-che-preview-kubernetes/bundle.Dockerfile @@ -16,6 +16,6 @@ LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ # Copy files to locations specified by labels. -COPY bundle/nightly/eclipse-che-preview-kubernetes/manifests /manifests/ -COPY bundle/nightly/eclipse-che-preview-kubernetes/metadata /metadata/ -COPY bundle/nightly/eclipse-che-preview-kubernetes/tests/scorecard /tests/scorecard/ +COPY manifests /manifests/ +COPY metadata /metadata/ +COPY tests/scorecard /tests/scorecard/ diff --git a/bundle/stable/eclipse-che-preview-openshift/bundle.Dockerfile b/bundle/stable/eclipse-che-preview-openshift/bundle.Dockerfile index 29b81e06d..adb8d7322 100644 --- a/bundle/stable/eclipse-che-preview-openshift/bundle.Dockerfile +++ b/bundle/stable/eclipse-che-preview-openshift/bundle.Dockerfile @@ -16,6 +16,6 @@ LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ # Copy files to locations specified by labels. -COPY bundle/nightly/eclipse-che-preview-openshift/manifests /manifests/ -COPY bundle/nightly/eclipse-che-preview-openshift/metadata /metadata/ -COPY bundle/nightly/eclipse-che-preview-openshift/tests/scorecard /tests/scorecard/ +COPY manifests /manifests/ +COPY metadata /metadata/ +COPY tests/scorecard /tests/scorecard/