From 36879b48036923f20fe0fba144702de9f3bf83ca Mon Sep 17 00:00:00 2001 From: piotrmsc Date: Tue, 31 Aug 2021 11:02:34 +0200 Subject: [PATCH] fix: installing kubebuilder binary. Added anchor for installing kube builder and using links in the steps for it. --- .circleci/config.yml | 56 +++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 37 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d2904ac..6ff44c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,19 @@ +kube-builder: &install-kube-builder + name: Fetch kube-builder + command: | + os=$(go env GOOS) + arch=$(go env GOARCH) + + # Download kubebuilder and extract it to tmp + # Temporary solution, older versions of kubebuilder are nolonger available under old urls. + # Upgrading kubebuilder to latest version is a bigger story and needs more work. + # We will use direct GH release URL for now. + curl -sL https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.2/kubebuilder_2.3.2_${os}_${arch}.tar.gz | tar -xz -C /tmp/ + + # move to a long-term location and put it on your path + # (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else) + sudo mv /tmp/kubebuilder_2.3.2_${os}_${arch} /usr/local/kubebuilder + export PATH=$PATH:/usr/local/kubebuilder/bin version: 2 jobs: build: @@ -7,19 +23,7 @@ jobs: steps: - checkout - run: - name: Fetch kube-builder - command: | - os=$(go env GOOS) - arch=$(go env GOARCH) - - # download kubebuilder and extract it to tmp - curl -sL https://go.kubebuilder.io/dl/2.3.2/${os}/${arch} | tar -xz -C /tmp/ - - # move to a long-term location and put it on your path - # (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else) - sudo mv /tmp/kubebuilder_2.3.2_${os}_${arch} /usr/local/kubebuilder - export PATH=$PATH:/usr/local/kubebuilder/bin - + <<: *install-kube-builder - run: make test: docker: @@ -28,18 +32,7 @@ jobs: steps: - checkout - run: - name: Fetch kube-builder - command: | - os=$(go env GOOS) - arch=$(go env GOARCH) - - # download kubebuilder and extract it to tmp - curl -sL https://go.kubebuilder.io/dl/2.3.2/${os}/${arch} | tar -xz -C /tmp/ - - # move to a long-term location and put it on your path - # (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else) - sudo mv /tmp/kubebuilder_2.3.2_${os}_${arch} /usr/local/kubebuilder - export PATH=$PATH:/usr/local/kubebuilder/bin + <<: *install-kube-builder - run: make test test-integration: machine: true @@ -54,18 +47,7 @@ jobs: sudo echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.profile go version - run: - name: Download kube-builder - command: | - os=$(go env GOOS) - arch=$(go env GOARCH) - - # download kubebuilder and extract it to tmp - curl -sL https://go.kubebuilder.io/dl/2.3.2/${os}/${arch} | tar -xz -C /tmp/ - - # move to a long-term location and put it on your path - # (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else) - sudo mv /tmp/kubebuilder_2.3.2_${os}_${arch} /usr/local/kubebuilder - sudo echo "export PATH=$PATH:/usr/local/kubebuilder/bin" >> $HOME/.profile + <<: *install-kube-builder - run: name: Install kustomize command: |