Skip to content

Commit

Permalink
Merge pull request #1114 from eloycoto/s2iUpgrade
Browse files Browse the repository at this point in the history
S2I: Installed a new version if s2i version mismatch.
  • Loading branch information
eloycoto authored Sep 12, 2019
2 parents c67b514 + dd41876 commit 29bd8a7
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions travis/install-s2i.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,27 @@ arch=$(uname -m | sed 's/x86_/amd/' | tr -d 'i' | sed 's/686/386/')
version=$(echo "${S2I_VERSION}" | cut -f1 -d-)
sha=$(echo "${S2I_VERSION}" | cut -f2 -d-)

if [ ! -f "${PREFIX}/s2i" ]; then
install_s2i(){
cd /tmp/
mkdir -p "${PREFIX}"
wget -T 60 -c "https://github.com/openshift/source-to-image/releases/download/v${version}/source-to-image-v${version}-${sha}-${os}-${arch}.tar.gz" -O source-to-image.tar.gz
tar -xzf source-to-image.tar.gz -C "${PREFIX}/"
rm -rf source-to-image.tar.gz
else
echo "Using cached s2i."
}

if [ ! -f "${PREFIX}/s2i" ]; then
echo "Installing s2i"
install_s2i
exit 0
fi

installed_version=$(s2i version | awk '{print substr($2,2)}')


if [ "$installed_version" != "$version" ]; then
echo "Installing s2i because mismatched version current_version='$installed_version'"
# Installed a new version because it's not the same
install_s2i
fi

# Using installed version

0 comments on commit 29bd8a7

Please sign in to comment.