diff --git a/ci/prow/README.md b/ci/prow/README.md index 04fd12e6b..a11e3b378 100644 --- a/ci/prow/README.md +++ b/ci/prow/README.md @@ -8,3 +8,4 @@ This directory contains the config for our [Prow](https://github.com/kubernetes/ * `config.yaml` Configuration of the Prow jobs. * `config_start.yaml` Initial, empty configuration for Prow. * `plugins.yaml` Configuration of the Prow plugins. +* `run_job.sh` Convenience script to start a Prow job from command-line. diff --git a/ci/prow/run_job.sh b/ci/prow/run_job.sh new file mode 100755 index 000000000..5198bb09d --- /dev/null +++ b/ci/prow/run_job.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Simple script to start a Prow job. + +source $(dirname $0)/../../scripts/library.sh + +[[ -z "$1" ]] && abort "pass the name of the job to start as argument" + +set -e + +cd ${REPO_ROOT_DIR} + +make -C ./ci/prow get-cluster-credentials + +run_mkpj="mkpj" +[[ -z "$(which mkpj)" ]] && run_mkpj="bazel run @k8s//prow/cmd/mkpj --" + +JOB_YAML=$(mktemp) +CONFIG_YAML=${REPO_ROOT_DIR}/ci/prow/config.yaml +${run_mkpj} --job=$1 --config-path=${CONFIG_YAML} > ${JOB_YAML} +echo "Job YAML file saved to ${JOB_YAML}" +kubectl apply -f ${JOB_YAML}