Backport gitlab-ci-yml!128 - Fix kubectl version to 1.8.6

This commit extracts `kubectl`, `helm` and `codeclimate` versions as CI
variables.

`kubectl` changes from latest stable version to `1.8.6`, the other two are just
extracted in order to be easily updated; now we can also test tool upgrades
overriding CI secret variables.
parent 0e7e9e32
Pipeline #15773754 passed with stages
in 35 minutes and 8 seconds
---
title: Force Auto DevOps kubectl version to 1.8.6
merge_request: 16218
author:
type: fixed
......@@ -34,6 +34,10 @@ variables:
POSTGRES_ENABLED: "true"
POSTGRES_DB: $CI_ENVIRONMENT_SLUG
KUBERNETES_VERSION: 1.8.6
HELM_VERSION: 2.6.1
CODECLIMATE_VERSION: 0.69.0
stages:
- build
- test
......@@ -250,8 +254,8 @@ production:
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc"
docker run ${cc_opts} codeclimate/codeclimate:0.69.0 init
docker run ${cc_opts} codeclimate/codeclimate:0.69.0 analyze -f json > codeclimate.json
docker run ${cc_opts} "codeclimate/codeclimate:${CODECLIMATE_VERSION}" init
docker run ${cc_opts} "codeclimate/codeclimate:${CODECLIMATE_VERSION}" analyze -f json > codeclimate.json
}
function sast() {
......@@ -323,11 +327,11 @@ production:
apk add glibc-2.23-r3.apk
rm glibc-2.23-r3.apk
curl https://kubernetes-helm.storage.googleapis.com/helm-v2.6.1-linux-amd64.tar.gz | tar zx
curl "https://kubernetes-helm.storage.googleapis.com/helm-v${HELM_VERSION}-linux-amd64.tar.gz" | tar zx
mv linux-amd64/helm /usr/bin/
helm version --client
curl -L -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
curl -L -o /usr/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
chmod +x /usr/bin/kubectl
kubectl version --client
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment