-
Notifications
You must be signed in to change notification settings - Fork 205
Expand file tree
/
Copy path03_agent_build_installer.sh
More file actions
executable file
·35 lines (27 loc) · 1.23 KB
/
03_agent_build_installer.sh
File metadata and controls
executable file
·35 lines (27 loc) · 1.23 KB
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
29
30
31
32
33
34
35
#!/usr/bin/env bash
set -euxo pipefail
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
LOGDIR=${SCRIPTDIR}/logs
source $SCRIPTDIR/logging.sh
source $SCRIPTDIR/common.sh
source $SCRIPTDIR/agent/common.sh
# Override build tags
export OPENSHIFT_INSTALLER_BUILD_TAGS=" "
source $SCRIPTDIR/03_build_installer.sh
# Writes the currently used openshift version in the installer binary,
# if it was built from src
function patch_openshift_install_version() {
local res=$(grep -oba ._RELEASE_VERSION_LOCATION_.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ${OCP_DIR}/openshift-install)
local location=${res%%:*}
# If the release marker was found then it means that the version is missing
if [[ ! -z ${location} ]]; then
version="$(openshift_release_version ${OCP_DIR})"
echo "Patching openshift-install with version ${version}"
printf "${version}\0" | dd of=${OCP_DIR}/openshift-install bs=1 seek=${location} conv=notrunc &> /dev/null
fi
}
# Copy install binary if built from src
if [ ! -z "$KNI_INSTALL_FROM_GIT" -a -f "$OPENSHIFT_INSTALL_PATH/bin/openshift-install" ]; then
cp "$OPENSHIFT_INSTALL_PATH/bin/openshift-install" "$OCP_DIR"
patch_openshift_install_version
fi