Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 01_install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ sudo pip install \
oc_version=4.1
oc_tools_dir=$HOME/oc-${oc_version}
oc_tools_local_file=openshift-client-${oc_version}.tar.gz
oc_date=0
if which oc 2>&1 >/dev/null ; then
oc_date=$(date -d $(oc version -o json | jq -r '.clientVersion.buildDate') +%s)
fi
if [ ! -f ${oc_tools_dir}/${oc_tools_local_file} ] || [ $oc_date -lt 1558047075 ]; then
oc_etag_last=$(cat ${oc_tools_dir}/etag.txt)
oc_etag_current=$(curl -I https://mirror.openshift.com/pub/openshift-v4/clients/oc/{$oc_version}/linux/oc.tar.gz | awk -F\" '/ETag/ {print $2}')

if [ -z ${oc_etag_last} ] || [ ${oc_etag_last} != ${oc_etag_current} ]; then
mkdir -p ${oc_tools_dir}
cd ${oc_tools_dir}
wget https://mirror.openshift.com/pub/openshift-v4/clients/oc/${oc_version}/linux/oc.tar.gz -O ${oc_tools_local_file}
tar xvzf ${oc_tools_local_file}
sudo cp oc /usr/local/bin/
echo ${oc_etag_current} > ${oc_tools_dir}/etag.txt
fi