mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-12 11:32:56 +01:00
add script to download k8s tooling with back-off mechanism
make fetch timeout configurable add CNG image building pipeline
This commit is contained in:
parent
d137b4ba28
commit
0493539020
2 changed files with 50 additions and 0 deletions
32
scripts/install-k8s-tooling
Normal file
32
scripts/install-k8s-tooling
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
export KUBECTL_VERSION=${KUBECTL_VERSION:-"v1.19.7"}
|
||||
export HELM_VERSION=${HELM_VERSION:-"3.3.1"}
|
||||
export FETCH_TIMEOUT=${FETCH_TIMEOUT:-"5m"}
|
||||
|
||||
_fetch_helm(){
|
||||
curl -Ls https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz | tar zxf - \
|
||||
&& chmod +x linux-amd64/helm \
|
||||
&& mv linux-amd64/helm /usr/local/bin/ \
|
||||
&& rm -rf linux-amd64/
|
||||
}
|
||||
|
||||
fetch_helm(){
|
||||
until _fetch_helm ; do sleep 30; done
|
||||
}
|
||||
|
||||
export -f fetch_helm _fetch_helm
|
||||
timeout ${FETCH_TIMEOUT} bash -xc fetch_helm
|
||||
|
||||
_fetch_kubectl(){
|
||||
curl -LsO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl \
|
||||
&& chmod +x kubectl \
|
||||
&& mv kubectl /usr/local/bin/kubectl
|
||||
}
|
||||
|
||||
fetch_kubectl(){
|
||||
until _fetch_kubectl ; do sleep 30 ; done
|
||||
}
|
||||
|
||||
export -f fetch_kubectl _fetch_kubectl
|
||||
timeout ${FETCH_TIMEOUT} bash -xc fetch_kubectl
|
||||
Loading…
Add table
Add a link
Reference in a new issue