Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the install-sdk target #653

Merged
Merged
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions .ci/install-sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

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

jpkrohling marked this conversation as resolved.
Show resolved Hide resolved
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}
}

mkdir -p ${GOPATH}/bin

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