Skip to content

Commit

Permalink
Fix release script after updating test-infra
Browse files Browse the repository at this point in the history
Also remove unnecessary stuff from `e2e-tests.sh`
  • Loading branch information
adrcunha authored and knative-prow-robot committed Jan 29, 2019
1 parent 516ce25 commit f9dac68
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 56 deletions.
67 changes: 16 additions & 51 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
6 changes: 1 addition & 5 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f9dac68

Please sign in to comment.