From f9dac68f06523113d8f88432717f2d73a46f1f42 Mon Sep 17 00:00:00 2001 From: Adriano Cunha Date: Mon, 28 Jan 2019 15:58:06 -0800 Subject: [PATCH] Fix release script after updating test-infra Also remove unnecessary stuff from `e2e-tests.sh` --- hack/release.sh | 67 +++++++++++------------------------------------ test/e2e-tests.sh | 6 +---- 2 files changed, 17 insertions(+), 56 deletions(-) diff --git a/hack/release.sh b/hack/release.sh index 06b9c99196c..0525c3033e6 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -19,54 +19,19 @@ source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/release.sh # Local generated yaml file readonly OUTPUT_YAML=release.yaml -# Script entry point - -initialize $@ - -set -o errexit -set -o pipefail - -# When building a versioned release, we must use .ko.yaml.release -if (( BRANCH_RELEASE )); then - # KO_CONFIG_PATH expects a path containing a .ko.yaml file - export KO_CONFIG_PATH="$(mktemp -d)" - cp .ko.yaml.release "${KO_CONFIG_PATH}/.ko.yaml" - echo "- Using .ko.yaml.release for base image overrides" -fi - -run_validation_tests ./test/presubmit-tests.sh - -# Build the release - -banner "Building the release" - -# Location of the base image for creds-init and git images -readonly PIPELINE_BASE_GCR="${KO_DOCKER_REPO}/github.com/knative/build-pipeline/build-base" - -# Build should not try to deploy anything, use a bogus value for cluster. -export K8S_CLUSTER_OVERRIDE=CLUSTER_NOT_SET -export K8S_USER_OVERRIDE=USER_NOT_SET -export DOCKER_REPO_OVERRIDE=DOCKER_NOT_SET - -# Build the base image for creds-init and git images. -docker build -t ${PIPELINE_BASE_GCR} -f images/Dockerfile images/ - -echo "Building build-pipeline" -ko resolve ${KO_FLAGS} -f config/ > ${OUTPUT_YAML} -tag_images_in_yaml ${OUTPUT_YAML} - -echo "New release built successfully" - -if (( ! PUBLISH_RELEASE )); then - exit 0 -fi - -# Push the base image for creds-init and git images. -echo "Pushing base images to ${PIPELINE_BASE_GCR}" -docker push ${PIPELINE_BASE_GCR} - -publish_yaml ${OUTPUT_YAML} ${BUILD_PIPELINE_RELEASE_GCS} ${TAG} - -branch_release "Knative Build Pipeline" "${OUTPUT_YAML}" - -echo "New release published successfully" +function build_release() { + # When building a versioned release, we must use .ko.yaml.release + if (( PUBLISH_TO_GITHUB )); then + # KO_CONFIG_PATH expects a path containing a .ko.yaml file + export KO_CONFIG_PATH="$(mktemp -d)" + cp .ko.yaml.release "${KO_CONFIG_PATH}/.ko.yaml" + echo "Using .ko.yaml.release for base image overrides" + fi + # Build the base image for creds-init and git images. + docker build -t "${KO_DOCKER_REPO}/github.com/knative/build-pipeline/build-base" -f images/Dockerfile images/ + echo "Building build-pipeline" + ko resolve ${KO_FLAGS} -f config/ > ${OUTPUT_YAML} + YAMLS_TO_PUBLISH="${OUTPUT_YAML}" +} + +main $@ diff --git a/test/e2e-tests.sh b/test/e2e-tests.sh index 02da3da7b2c..2a1eb7b80b0 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-tests.sh @@ -25,11 +25,7 @@ initialize $@ header "Setting up environment" -# Handle failures ourselves, so we can dump useful info. -set +o errexit -set +o pipefail - -install_pipeline_crd +install_pipeline_crd failed=0