|
1 |
| -# If we're in OpenShift CI, get the sha for our PR. The one openshift-install version |
2 |
| -# reports isn't correct due to how CI rebases the PR before building. |
3 |
| -# |
4 |
| -# FIXME(stbenjam): If a PR branch is not current with master, there is a |
5 |
| -# potential for rhcos.json to be out of date. The potential solutions to |
6 |
| -# this are not ideal, we'll either have to checkout the repo ourselves and |
7 |
| -# check or make a bunch of API calls to see if the PR modified |
8 |
| -# rhcos.json, otherwise just always get master. |
9 |
| -if [[ "$JOB_NAME" =~ "openshift-installer" ]]; then |
10 |
| - OPENSHIFT_INSTALL_COMMIT=${PULL_PULL_SHA:-$(echo "$JOB_SPEC" | jq -r '.refs.pulls[0].sha')} |
| 1 | +if [[ -f "$OCP_DIR/rhcos.json" ]]; then |
| 2 | + MACHINE_OS_IMAGE_JSON=$(cat "$OCP_DIR/rhcos.json") |
11 | 3 | else
|
12 | 4 | # Get the git commit that the openshift installer was built from
|
13 | 5 | OPENSHIFT_INSTALL_COMMIT=$($OPENSHIFT_INSTALLER version | grep commit | cut -d' ' -f4)
|
14 |
| -fi |
15 | 6 |
|
16 |
| -# Get the rhcos.json for that commit |
17 |
| -OPENSHIFT_INSTALLER_MACHINE_OS=${OPENSHIFT_INSTALLER_MACHINE_OS:-https://raw.githubusercontent.com/openshift/installer/$OPENSHIFT_INSTALL_COMMIT/data/data/rhcos.json} |
| 7 | + # Get the rhcos.json for that commit |
| 8 | + OPENSHIFT_INSTALLER_MACHINE_OS=${OPENSHIFT_INSTALLER_MACHINE_OS:-https://raw.githubusercontent.com/openshift/installer/$OPENSHIFT_INSTALL_COMMIT/data/data/rhcos.json} |
18 | 9 |
|
19 |
| -# Get the rhcos.json for that commit, and find the baseURI and openstack image path |
20 |
| -MACHINE_OS_IMAGE_JSON=$(curl "${OPENSHIFT_INSTALLER_MACHINE_OS}") |
| 10 | + # Get the rhcos.json for that commit, and find the baseURI and openstack image path |
| 11 | + MACHINE_OS_IMAGE_JSON=$(curl "${OPENSHIFT_INSTALLER_MACHINE_OS}") |
| 12 | +fi |
21 | 13 |
|
22 | 14 | export MACHINE_OS_INSTALLER_IMAGE_URL=$(echo "${MACHINE_OS_IMAGE_JSON}" | jq -r '.baseURI + .images.openstack.path')
|
23 | 15 | export MACHINE_OS_INSTALLER_IMAGE_SHA256=$(echo "${MACHINE_OS_IMAGE_JSON}" | jq -r '.images.openstack.sha256')
|
|
0 commit comments