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

cluster-up: Fix tag updating #2189

Merged
merged 1 commit into from
Dec 22, 2022
Merged
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
16 changes: 16 additions & 0 deletions cluster/kubevirtci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,24 @@
export KUBEVIRT_PROVIDER=${KUBEVIRT_PROVIDER:-'k8s-1.23'}
export KUBEVIRTCI_TAG=$(curl -L -Ss https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirtci/latest)
KUBEVIRTCI_PATH="${PWD}/_kubevirtci"
KUBEVIRTCI_REPO='https://github.com/kubevirt/kubevirtci.git'

function cluster::_get_repo() {
git --git-dir ${KUBEVIRTCI_PATH}/.git remote get-url origin
}

function cluster::_get_tag() {
git -C ${KUBEVIRTCI_PATH} describe --tags
}

function kubevirtci::install() {
# Remove cloned kubevirtci repository if it does not match the requested one
if [ -d ${KUBEVIRTCI_PATH} ]; then
if [ $(cluster::_get_repo) != ${KUBEVIRTCI_REPO} ] || [ $(cluster::_get_tag) != ${KUBEVIRTCI_TAG} ]; then
rm -rf ${KUBEVIRTCI_PATH}
fi
fi

if [ ! -d ${KUBEVIRTCI_PATH} ]; then
git clone https://github.com/kubevirt/kubevirtci.git ${KUBEVIRTCI_PATH}
(
Expand Down