forked from openshift/release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob.sh
executable file
·28 lines (24 loc) · 959 Bytes
/
job.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Create a new run of the Prow job
set -euo pipefail
BASE="$( dirname "${BASH_SOURCE[0]}" )"
source "$BASE/images.sh"
if [[ -n "${GITHUB_TOKEN_PATH:-}" ]]; then
volume="--volume $( dirname "${GITHUB_TOKEN_PATH}" ):/secrets:z"
arg="--github-token-path /secrets/$( basename "${GITHUB_TOKEN_PATH}" )"
fi
CONTAINER_ENGINE=${CONTAINER_ENGINE:-docker}
if [ -z ${VOLUME_MOUNT_FLAGS+x} ]; then VOLUME_MOUNT_FLAGS=':z'; else echo "VOLUME_MOUNT_FLAGS is set to '$VOLUME_MOUNT_FLAGS'"; fi
$CONTAINER_ENGINE run \
--rm \
--volume "$PWD:/tmp/release${VOLUME_MOUNT_FLAGS}" \
${volume:-} \
--workdir /tmp/release \
"$MKPJ_IMG" \
--config-path core-services/prow/02_config/_config.yaml \
--job-config-path ci-operator/jobs/ \
${BASE_REF:+"--base-ref" "${BASE_REF}"} \
${PULL_NUMBER:+"--pull-number" "${PULL_NUMBER}"} \
${arg:-} \
--job "${1}" |
oc --context app.ci --namespace ci --as system:admin apply -f -