k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/config/mkpj.sh (about) 1 #!/usr/bin/env bash 2 # Copyright 2020 The Kubernetes Authors. 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 # Usage: mkpj.sh --job=foo ... 17 # 18 # Arguments to this script will be passed to a dockerized mkpj 19 # 20 # Example Usage: 21 # config/mkpj.sh --job=post-test-infra-push-bootstrap | kubectl create -f - 22 # (type "master" at the Base ref prompt) 23 # 24 # NOTE: kubectl should be pointed at the prow services cluster you intend 25 # to create the prowjob in! 26 # 27 # You can also use bazel run //prow/cmd/mkpj instead. 28 # TODO: this won't be true if we move prow to it's own repo... 29 # https://github.com/kubernetes/test-infra/issues/11782 30 31 root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" 32 config="${root}/config/prow/config.yaml" 33 job_config_path="${root}/config/jobs" 34 35 docker pull gcr.io/k8s-prow/mkpj 1>&2 || true 36 docker run \ 37 -i --rm \ 38 --user "$(id -u):$(id -g)" \ 39 -v "${root}:${root}" \ 40 --security-opt="label=disable" \ 41 gcr.io/k8s-prow/mkpj \ 42 "--config-path=${config}" "--job-config-path=${job_config_path}" "$@"