forked from jaegertracing/jaeger-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve reliability of some scripts to download third party tools (ja…
…egertracing#1779) * Improve reliability of some scripts to download third party tools jaegertracing#1778 jaegertracing#1750 Signed-off-by: Israel Blancas <[email protected]> * Fix finx kind binary Signed-off-by: Israel Blancas <[email protected]>
- Loading branch information
Israel Blancas
authored
Mar 21, 2022
1 parent
61c23d2
commit 6901a72
Showing
22 changed files
with
240 additions
and
124 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ on: | |
jobs: | ||
basic-checks: | ||
runs-on: ubuntu-20.04 | ||
env: | ||
USER: jaegertracing | ||
steps: | ||
- name: Set up Go | ||
uses: actions/[email protected] | ||
|
@@ -23,10 +25,10 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: "install kubebuilder" | ||
run: ./hack/install-kubebuilder.sh | ||
run: ./hack/install/install-kubebuilder.sh | ||
|
||
- name: "install kustomize" | ||
run: ./hack/install-kustomize.sh | ||
run: ./hack/install/install-kustomize.sh | ||
|
||
- name: "basic checks" | ||
run: make install-tools ci | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ on: | |
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
env: | ||
USER: jaegertracing | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ on: | |
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-20.04 | ||
env: | ||
USER: jaegertracing | ||
steps: | ||
- name: Set up Go | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,6 @@ check: | |
$(VECHO)[ ! -s "$(FMT_LOG)" ] || (echo "Go fmt, license check, or import ordering failures, run 'make format'" | cat - $(FMT_LOG) && false) | ||
|
||
ensure-generate-is-noop: VERSION=$(OPERATOR_VERSION) | ||
ensure-generate-is-noop: USER=jaegertracing | ||
ensure-generate-is-noop: set-image-controller generate bundle | ||
$(VECHO)# on make bundle config/manager/kustomization.yaml includes changes, which should be ignored for the below check | ||
$(VECHO)git restore config/manager/kustomization.yaml | ||
|
@@ -332,10 +331,6 @@ CONTROLLER_GEN = $(shell pwd)/bin/controller-gen | |
controller-gen: ## Download controller-gen locally if necessary. | ||
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected]) | ||
|
||
KUSTOMIZE = $(shell pwd)/bin/kustomize | ||
kustomize: ## Download kustomize locally if necessary. | ||
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected]) | ||
|
||
ENVTEST = $(shell pwd)/bin/setup-envtest | ||
envtest: ## Download envtest-setup locally if necessary. | ||
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) | ||
|
@@ -442,45 +437,11 @@ release-artifacts: set-image-controller | |
mkdir -p dist | ||
$(KUSTOMIZE) build config/default -o dist/jaeger-operator.yaml | ||
|
||
|
||
kuttl: | ||
ifeq (, $(shell which kubectl-kuttl)) | ||
echo ${PATH} | ||
ls -l /usr/local/bin | ||
which kubectl-kuttl | ||
|
||
@{ \ | ||
set -e ;\ | ||
echo "" ;\ | ||
echo "ERROR: kuttl not found." ;\ | ||
echo "Please check https://kuttl.dev/docs/cli.html for installation instructions and try again." ;\ | ||
echo "" ;\ | ||
exit 1 ;\ | ||
} | ||
else | ||
KUTTL=$(shell which kubectl-kuttl) | ||
endif | ||
|
||
# Set the controller image parameters | ||
set-image-controller: manifests kustomize | ||
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} | ||
|
||
kind: | ||
ifeq ($(USE_KIND_CLUSTER),true) | ||
ifeq (, $(shell which kind)) | ||
@{ \ | ||
set -e ;\ | ||
echo "" ;\ | ||
echo "ERROR: KIND not found." ;\ | ||
echo "Please check https://kind.sigs.k8s.io/docs/user/quick-start/#installation for installation instructions and try again." ;\ | ||
echo "" ;\ | ||
exit 1 ;\ | ||
} | ||
else | ||
KIND=$(shell which kind) | ||
endif | ||
endif | ||
|
||
.PHONY: tools | ||
tools: kustomize controller-gen operator-sdk | ||
|
||
.PHONY: install-tools | ||
|
@@ -489,7 +450,21 @@ install-tools: operator-sdk | |
golang.org/x/lint/golint \ | ||
golang.org/x/tools/cmd/goimports \ | ||
github.com/securego/gosec/cmd/[email protected] | ||
$(VECHO)./.ci/install-gomplate.sh | ||
|
||
.PHONY: kustomize | ||
kustomize: | ||
./hack/install/install-kustomize.sh | ||
$(eval KUSTOMIZE=$(shell echo ${PWD}/bin/kustomize)) | ||
|
||
.PHONY: kuttl | ||
kuttl: | ||
./hack/install/install-kuttl.sh | ||
$(eval KUTTL=$(shell echo ${PWD}/bin/kubectl-kuttl)) | ||
|
||
.PHONY: kind | ||
kind: | ||
./hack/install/install-kind.sh | ||
$(eval KIND=$(shell echo ${PWD}/bin/kind)) | ||
|
||
.PHONY: prepare-release | ||
prepare-release: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
VERSION="3.10.0" | ||
|
||
current_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source $current_dir/install-utils.sh | ||
|
||
PROGRAM="gomplate" | ||
|
||
url="https://github.com/hairyhenderson/gomplate/releases/download/v${VERSION}/gomplate_$(go env GOOS)-amd64-slim" | ||
|
||
download $PROGRAM $VERSION $url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
VERSION="0.11.1" | ||
|
||
current_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source $current_dir/install-utils.sh | ||
|
||
PROGRAM="kind" | ||
|
||
url="https://kind.sigs.k8s.io/dl/v$VERSION/kind-$(go env GOOS)-amd64" | ||
|
||
download $PROGRAM $VERSION $url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
VERSION="2.3.1" | ||
|
||
current_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source $current_dir/install-utils.sh | ||
|
||
PROGRAM="kubebuilder" | ||
|
||
create_bin | ||
|
||
check_tool "$BIN/$PROGRAM" $VERSION "version" | ||
|
||
url="https://github.com/kubernetes-sigs/kubebuilder/releases/download/v$VERSION/kubebuilder_${VERSION}_$(go env GOOS)_amd64.tar.gz" | ||
|
||
tar_file="/tmp/kubebuilder.tar.gz" | ||
retry "curl -sLo $tar_file $url" | ||
tar -xzf $tar_file -C /tmp/ | ||
|
||
cp /tmp/kubebuilder_${VERSION}_$(go env GOOS)_amd64/bin/* $BIN/ | ||
|
||
export PATH=$PATH:$BIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
VERSION="4.2.0" | ||
|
||
current_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source $current_dir/install-utils.sh | ||
|
||
PROGRAM="kustomize" | ||
|
||
create_bin | ||
|
||
check_tool "$BIN/$PROGRAM" $VERSION "version" | ||
|
||
url="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${VERSION}/kustomize_v${VERSION}_$(go env GOOS)_amd64.tar.gz" | ||
|
||
tar_file="/tmp/kustomize.tar.gz" | ||
retry "curl -sLo $tar_file $url" | ||
tar -xzf $tar_file -C $BIN | ||
|
||
export PATH=$PATH:$BIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
VERSION="0.11.1" | ||
|
||
current_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source $current_dir/install-utils.sh | ||
|
||
PROGRAM="kubectl-kuttl" | ||
|
||
url="https://github.com/kudobuilder/kuttl/releases/download/v$VERSION/kubectl-kuttl_${VERSION}_$(go env GOOS)_x86_64" | ||
|
||
download $PROGRAM $VERSION $url |
Oops, something went wrong.