Skip to content

Commit

Permalink
Add a convenience script to start a Prow job from command line (knati…
Browse files Browse the repository at this point in the history
  • Loading branch information
adrcunha authored and knative-prow-robot committed Dec 20, 2018
1 parent 4991cb9 commit b7d328b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions ci/prow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
36 changes: 36 additions & 0 deletions ci/prow/run_job.sh
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit b7d328b

Please sign in to comment.