From 45f078d6f15c4682e7f3b3efb8f60852d64b51df Mon Sep 17 00:00:00 2001 From: Andrejs Cunskis Date: Wed, 7 Feb 2024 05:11:19 +0000 Subject: [PATCH] Add image for cng deployment --- .gitlab/ci/e2e.images.yml | 15 +++++++++++++++ Dockerfile.custom | 6 ++++++ scripts/install-kind | 10 ++++++++++ scripts/lib/custom-docker-build | 22 ++++++++++++++++++++++ scripts/lib/custom-docker.sh | 2 +- 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100755 scripts/install-kind diff --git a/.gitlab/ci/e2e.images.yml b/.gitlab/ci/e2e.images.yml index 97341ae..55f810c 100644 --- a/.gitlab/ci/e2e.images.yml +++ b/.gitlab/ci/e2e.images.yml @@ -12,6 +12,8 @@ - "scripts/install-gcloud" - "scripts/install-git" - "scripts/install-kubectl" + - "scripts/install-kind" + - "scripts/install-helm" - "scripts/install-lfs" - "scripts/install-ruby" - ".gitlab/ci/e2e.images.yml" @@ -44,6 +46,19 @@ e2e-chrome: BUNDLER: ['2.4', '2.5'] CHROME: ['119', '120'] +e2e-cng: + extends: + - e2e-docker + parallel: + matrix: + - OS: ['debian:bookworm'] + RUBY: ['3.1', '3.2'] + BUNDLER: ['2.5'] + CHROME: ['120'] + HELM: ['3.14'] + KIND: ['0.20'] + KUBECTL: ['1.23'] + # Image used for running full e2e test suite e2e-full: extends: diff --git a/Dockerfile.custom b/Dockerfile.custom index 71f0c11..1379fd7 100644 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -111,6 +111,12 @@ ARG HELM_DOWNLOAD_SHA256 RUN if [ -n "$HELM_VERSION" ] ; then /scripts/install-helm "$HELM_VERSION" "$HELM_DOWNLOAD_SHA256"; fi +# Kind +ARG KIND_VERSION +ARG KIND_DOWNLOAD_SHA256 + +RUN if [ -n "$KIND_VERSION" ] ; then /scripts/install-kind "$KIND_VERSION" "$KIND_DOWNLOAD_SHA256"; fi + RUN /scripts/generate-locale ENV LANG=C.UTF-8 \ LANGUAGE=C \ diff --git a/scripts/install-kind b/scripts/install-kind new file mode 100755 index 0000000..54f4a63 --- /dev/null +++ b/scripts/install-kind @@ -0,0 +1,10 @@ +#!/bin/bash + +set -eu + +KIND_VERSION=${1} +KIND_DOWNLOAD_SHA256=${2} + +/scripts/download-file "kind" "https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-${TARGETARCH:-amd64}" "$KIND_DOWNLOAD_SHA256" +chmod +x kind +mv kind /usr/local/bin/ && kind --version diff --git a/scripts/lib/custom-docker-build b/scripts/lib/custom-docker-build index 8192089..9cd3d05 100755 --- a/scripts/lib/custom-docker-build +++ b/scripts/lib/custom-docker-build @@ -319,6 +319,11 @@ function print_helm_args() { HELM_DOWNLOAD_SHA256[amd64]=31960ff2f76a7379d9bac526ddf889fb79241191f1dbe2a24f7864ddcb3f6560 HELM_DOWNLOAD_SHA256[arm64]=d24163e466f7884c55079d1050968e80a05b633830047116cdfd8ae28d35b0c0 ;; + 3.14) + HELM_VERSION=3.14.0 + HELM_DOWNLOAD_SHA256[amd64]=f43e1c3387de24547506ab05d24e5309c0ce0b228c23bd8aa64e9ec4b8206651 + HELM_DOWNLOAD_SHA256[arm64]=b29e61674731b15f6ad3d1a3118a99d3cc2ab25a911aad1b8ac8c72d5a9d2952 + ;; *) fail "Unknown helm version $1" ;; esac @@ -326,6 +331,22 @@ function print_helm_args() { printf -- "--build-arg HELM_DOWNLOAD_SHA256=%q " "${HELM_DOWNLOAD_SHA256[*]}" } +function print_kind_args() { + declare -A KIND_DOWNLOAD_SHA256 + + case "$1" in + 0.20) + KIND_VERSION=0.20.0 + KIND_DOWNLOAD_SHA256[amd64]=513a7213d6d3332dd9ef27c24dab35e5ef10a04fa27274fe1c14d8a246493ded + KIND_DOWNLOAD_SHA256[arm64]=639f7808443559aa30c3642d9913b1615d611a071e34f122340afeda97b8f422 + ;; + *) fail "Unknown helm version $1" ;; + esac + + printf -- "--build-arg KIND_VERSION=%s " "$KIND_VERSION" + printf -- "--build-arg KIND_DOWNLOAD_SHA256=%q " "${KIND_DOWNLOAD_SHA256[*]}" +} + function parse_arguments() { printf -- "-f Dockerfile.custom " @@ -368,6 +389,7 @@ function parse_arguments() { GCLOUD) print_gcloud_args $version ;; KUBECTL) print_kubectl_args $version ;; HELM) print_helm_args $version ;; + KIND) print_kind_args $version ;; *) fail "Unknown tool $tool" ;; esac fi diff --git a/scripts/lib/custom-docker.sh b/scripts/lib/custom-docker.sh index ff5938a..785317b 100644 --- a/scripts/lib/custom-docker.sh +++ b/scripts/lib/custom-docker.sh @@ -2,7 +2,7 @@ # various variable operations used in this script. PATH_TOOLS=(DEBIAN OS UBI RUBY GOLANG RUST NODE POSTGRESQL) -TAG_TOOLS=(BUNDLER RUBYGEMS GIT LFS CHROME YARN GRAPHICSMAGICK EXIFTOOL BAZELISK DOCKER GCLOUD KUBECTL HELM) +TAG_TOOLS=(BUNDLER RUBYGEMS GIT LFS CHROME YARN GRAPHICSMAGICK EXIFTOOL BAZELISK DOCKER GCLOUD KUBECTL HELM KIND) # Generate the docker image path using the components that were specified via # variables.