Install `oc`
The immediate motivation is
For RHEL CoreOS related stuff in particular it's just really useful to have
the `oc` binary in coreos-assembler to streamline things like
"build a new release image that overrides the OS" etc.
I suspect this would help OKD too.
#!/usr/bin/env bash
set -euo pipefail
+# Currently used to determine the version of `oc` we install
+OCP_VERSION=4.10
+
# Keep this script idempotent for local development rebuild use cases:
# any consecutive runs should produce the same result.
@@ -84,6 +87,14 @@ install_rpms() {
yum clean all
}
+# For now, we ship `oc` in coreos-assembler as {Fedora,RHEL} CoreOS is an essential part of OCP4,
+# and it is very useful to have in the same place/flow as where we do builds/tests related
+# to CoreOS.
+install_ocp_tools() {
+ curl -L https://mirror.openshift.com/pub/openshift-v4/"$(arch)"/clients/ocp/latest-$OCP_VERSION/openshift-client-linux.tar.gz | tar zxf - oc \
+ && mv oc /usr/bin
+}
+
make_and_makeinstall() {
make && make install
}
@@ -127,5 +138,6 @@ else
install_rpms
write_archive_info
make_and_makeinstall
+ install_ocp_tools
configure_user
fi
