Skip to content

Commit

Permalink
Improved the install-sdk target
Browse files Browse the repository at this point in the history
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling committed Sep 9, 2019
1 parent c1f345b commit b127fe7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .ci/install-sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

DEST="${GOPATH}/bin/operator-sdk"

function install_sdk() {
echo "Downloading the operator-sdk ${SDK_VERSION} into ${DEST}"
curl https://github.com/operator-framework/operator-sdk/releases/download/${SDK_VERSION}/operator-sdk-${SDK_VERSION}-x86_64-linux-gnu -sLo ${DEST}
chmod +x ${DEST}
}

if [ ! -d ${GOPATH}/bin/ ]; then
mkdir -p ${GOPATH}/bin
fi

if [ ! -f ${DEST} ]; then
install_sdk
fi

${DEST} version | grep -q ${SDK_VERSION}
if [ $? != 0 ]; then
install_sdk
fi
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ scorecard:
.PHONY: install-sdk
install-sdk:
@echo Installing SDK ${SDK_VERSION}
@curl https://github.com/operator-framework/operator-sdk/releases/download/${SDK_VERSION}/operator-sdk-${SDK_VERSION}-x86_64-linux-gnu -sLo ${GOPATH}/bin/operator-sdk
@chmod +x ${GOPATH}/bin/operator-sdk
@SDK_VERSION=$(SDK_VERSION) GOPATH=$(GOPATH) ./.ci/install-sdk.sh

.PHONY: install-tools
install-tools:
Expand Down

0 comments on commit b127fe7

Please sign in to comment.