forked from openshift-metal3/dev-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_info.sh
More file actions
25 lines (19 loc) · 718 Bytes
/
release_info.sh
File metadata and controls
25 lines (19 loc) · 718 Bytes
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
function save_release_info() {
local release_image
local outdir
release_image="$1"
outdir="$2"
oc adm release info --registry-config "$PULL_SECRET_FILE" "$release_image" -o json > ${outdir}/release_info.json
}
# Gives us e.g 4.7 because although OPENSHIFT_VERSION is set by users,
# but is not set in CI
function openshift_version() {
jq -r ".metadata.version" ${OCP_DIR}/release_info.json | grep -oP "\d\.\d+"
}
# Gives e.g 4.7.0-0.nightly-2020-10-27-051128
function openshift_release_version() {
jq -r ".metadata.version" ${OCP_DIR}/release_info.json
}
function image_for() {
jq -r ".references.spec.tags[] | select(.name == \"$1\") | .from.name" ${OCP_DIR}/release_info.json
}