2023-07-10 19:31:10 +02:00
|
|
|
############
|
|
|
|
# Settings #
|
|
|
|
############
|
2021-06-16 15:26:09 +02:00
|
|
|
image: docker
|
|
|
|
services:
|
|
|
|
- docker:dind
|
2023-07-10 19:31:10 +02:00
|
|
|
stages:
|
|
|
|
- readme
|
|
|
|
- revert
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- manifest
|
|
|
|
variables:
|
|
|
|
DOCKER_AUTH_CONFIG: ${_DOCKER_AUTH_CONFIG}
|
|
|
|
KASM_RELEASE: "1.14.0"
|
|
|
|
TEST_INSTALLER: "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm_backend/7cbc7854255820c60cfecb2dee5177c1663af43a/kasm_workspaces_feature_KASM-4513-slim-upgrades_1.14.0.7cbc78.tar.gz"
|
|
|
|
before_script:
|
|
|
|
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
|
|
|
- export SANITIZED_BRANCH="$(echo $CI_COMMIT_REF_NAME | sed -r 's#^release/##' | sed 's/\//_/g')"
|
2021-06-16 15:26:09 +02:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
################
|
|
|
|
# YAML anchors #
|
|
|
|
################
|
|
|
|
|
|
|
|
# Metadata format - name-part1|name-part2|baseimage|wallpaper|distro|dockerfile
|
|
|
|
.MULTI_ARCH_BUILDS: &MULTI_ARCH_BUILDS
|
|
|
|
- "ubuntu|bionic|ubuntu:18.04|bg_bionic.png|ubuntu|dockerfile-kasm-core"
|
|
|
|
- "ubuntu|focal|ubuntu:20.04|bg_focal.png|ubuntu|dockerfile-kasm-core"
|
|
|
|
- "ubuntu|jammy|ubuntu:22.04|bg_jammy.png|ubuntu|dockerfile-kasm-core"
|
|
|
|
- "debian|bullseye|debian:bullseye-slim|bg_debian.svg|debian|dockerfile-kasm-core"
|
|
|
|
- "debian|bookworm|debian:bookworm-slim|bg_debian.svg|debian|dockerfile-kasm-core"
|
|
|
|
- "kali|rolling|kalilinux/kali-rolling:latest|bg_kasm.png|kali|dockerfile-kasm-core"
|
|
|
|
- "oracle|8|oraclelinux:8|bg_oracle.png|oracle8|dockerfile-kasm-core-oracle"
|
|
|
|
- "oracle|9|oraclelinux:9|bg_oracle.png|oracle9|dockerfile-kasm-core-oracle"
|
|
|
|
- "rockylinux|8|rockylinux:8|bg_rocky.png|rockylinux8|dockerfile-kasm-core-oracle"
|
|
|
|
- "rockylinux|9|rockylinux:9|bg_rocky.png|rockylinux9|dockerfile-kasm-core-oracle"
|
|
|
|
- "almalinux|8|almalinux:8|bg_almalinux.png|almalinux8|dockerfile-kasm-core-oracle"
|
|
|
|
- "almalinux|9|almalinux:9|bg_almalinux.png|almalinux9|dockerfile-kasm-core-oracle"
|
|
|
|
- "opensuse|15|opensuse/leap:15.5|bg_opensuse.png|opensuse|dockerfile-kasm-core-suse"
|
|
|
|
- "fedora|37|fedora:37|bg_fedora.png|fedora37|dockerfile-kasm-core-fedora"
|
|
|
|
- "fedora|38|fedora:38|bg_fedora.png|fedora38|dockerfile-kasm-core-fedora"
|
|
|
|
- "parrotos|5|parrotsec/core:latest|bg_parrotos5.jpg|parrotos5|dockerfile-kasm-core"
|
|
|
|
- "alpine|317|alpine:3.17|bg_alpine.png|alpine|dockerfile-kasm-core-alpine"
|
|
|
|
- "alpine|318|alpine:3.18|bg_alpine.png|alpine|dockerfile-kasm-core-alpine"
|
|
|
|
.SINGLE_ARCH_BUILDS: &SINGLE_ARCH_BUILDS
|
|
|
|
- "cuda|focal|nvidia/cuda:11.6.2-cudnn8-devel-ubuntu20.04|bg_focal.png|ubuntu|dockerfile-kasm-core"
|
|
|
|
- "centos|7|centos:centos7|bg_centos.png|centos|dockerfile-kasm-core-centos"
|
|
|
|
- "oracle|7|oraclelinux:7|bg_oracle.png|oracle7|dockerfile-kasm-core-oracle"
|
|
|
|
|
|
|
|
###############################################
|
|
|
|
# Build Containers and push to cache endpoint #
|
|
|
|
###############################################
|
|
|
|
build_multi_containers:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/build.sh "${BUILD_META}"
|
2023-03-15 21:09:15 +01:00
|
|
|
except:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
2023-03-15 21:09:15 +01:00
|
|
|
tags:
|
|
|
|
- ${TAG}
|
2023-07-10 19:31:10 +02:00
|
|
|
retry: 1
|
2023-03-15 21:09:15 +01:00
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- TAG: [ aws-autoscale, aws-autoscale-arm64 ]
|
2023-07-10 19:31:10 +02:00
|
|
|
BUILD_META: *MULTI_ARCH_BUILDS
|
2023-03-15 21:09:15 +01:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
build_single_containers:
|
2023-06-15 15:52:33 +02:00
|
|
|
stage: build
|
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/build.sh "${BUILD_META}"
|
2023-06-15 15:52:33 +02:00
|
|
|
except:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
2023-06-15 15:52:33 +02:00
|
|
|
tags:
|
2023-07-10 19:31:10 +02:00
|
|
|
- aws-autoscale
|
|
|
|
retry: 1
|
2023-06-15 15:52:33 +02:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- BUILD_META: *SINGLE_ARCH_BUILDS
|
2023-06-15 15:52:33 +02:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
######################################
|
|
|
|
# Test containers and upload results #
|
|
|
|
######################################
|
|
|
|
test_multi:
|
2023-03-15 21:09:15 +01:00
|
|
|
stage: test
|
2023-07-10 19:31:10 +02:00
|
|
|
when: always
|
2023-03-15 21:09:15 +01:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/test.sh "${BUILD_META}" "${ARCH}" "${EC2_LAUNCHER_ID}" "${EC2_LAUNCHER_SECRET}"
|
2022-05-03 17:00:05 +02:00
|
|
|
except:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
2022-05-03 17:00:05 +02:00
|
|
|
tags:
|
2023-07-10 19:31:10 +02:00
|
|
|
- aws-autoscale-nano
|
|
|
|
retry: 1
|
2022-05-03 17:00:05 +02:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- ARCH: [ "x86_64", "aarch64" ]
|
|
|
|
BUILD_META: *MULTI_ARCH_BUILDS
|
2022-05-03 17:00:05 +02:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
test_single:
|
2022-11-04 21:27:13 +01:00
|
|
|
stage: test
|
2023-07-10 19:31:10 +02:00
|
|
|
when: always
|
2022-11-04 21:27:13 +01:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/test.sh "${BUILD_META}" "x86_64" "${EC2_LAUNCHER_ID}" "${EC2_LAUNCHER_SECRET}"
|
2022-11-04 21:27:13 +01:00
|
|
|
except:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
2022-11-04 21:27:13 +01:00
|
|
|
tags:
|
2023-07-10 19:31:10 +02:00
|
|
|
- aws-autoscale-nano
|
|
|
|
retry: 1
|
2022-11-04 21:27:13 +01:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- BUILD_META: *SINGLE_ARCH_BUILDS
|
2022-11-04 21:27:13 +01:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
############################################
|
|
|
|
# Manifest Containers if their test passed #
|
|
|
|
############################################
|
|
|
|
manifest_multi:
|
2022-05-03 17:00:05 +02:00
|
|
|
stage: manifest
|
2022-11-04 21:27:13 +01:00
|
|
|
when: always
|
2022-05-11 18:28:40 +02:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/manifest.sh "${BUILD_META}" "multi"
|
2022-07-11 16:46:46 +02:00
|
|
|
except:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
2023-05-10 00:13:15 +02:00
|
|
|
tags:
|
|
|
|
- aws-autoscale-nano
|
2022-05-11 18:28:40 +02:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- BUILD_META: *MULTI_ARCH_BUILDS
|
2022-05-11 18:28:40 +02:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
manifest_single:
|
|
|
|
stage: manifest
|
2022-11-04 21:27:13 +01:00
|
|
|
when: always
|
2022-05-11 18:28:40 +02:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/manifest.sh "${BUILD_META}" "single"
|
2022-07-11 16:46:46 +02:00
|
|
|
except:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
2023-05-10 00:13:15 +02:00
|
|
|
tags:
|
|
|
|
- aws-autoscale-nano
|
2022-05-11 18:28:40 +02:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- BUILD_META: *SINGLE_ARCH_BUILDS
|
2022-06-23 15:43:10 +02:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
####################
|
|
|
|
# Helper Functions #
|
|
|
|
####################
|
2021-06-16 15:26:09 +02:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
## Update Readmes ##
|
|
|
|
update_readmes_multi:
|
|
|
|
stage: readme
|
2023-03-15 21:09:15 +01:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/readme.sh "${BUILD_META}"
|
2023-03-16 15:16:41 +01:00
|
|
|
only:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
2023-03-16 15:16:41 +01:00
|
|
|
tags:
|
2023-07-10 19:31:10 +02:00
|
|
|
- aws-autoscale-nano
|
2023-03-16 15:16:41 +01:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- BUILD_META: *MULTI_ARCH_BUILDS
|
2023-03-15 21:09:15 +01:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
update_readmes_single:
|
|
|
|
stage: readme
|
2023-06-15 15:52:33 +02:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- apk add bash
|
|
|
|
- bash ci-scripts/readme.sh "${BUILD_META}"
|
2023-06-15 15:52:33 +02:00
|
|
|
only:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $README_USERNAME
|
|
|
|
- $README_PASSWORD
|
2023-06-15 15:52:33 +02:00
|
|
|
tags:
|
2023-07-10 19:31:10 +02:00
|
|
|
- aws-autoscale-nano
|
2023-06-15 15:52:33 +02:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- BUILD_META: *SINGLE_ARCH_BUILDS
|
2023-03-15 21:09:15 +01:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
## Revert Images to specific build id ##
|
|
|
|
dockerhub_revert_multi:
|
|
|
|
stage: revert
|
2023-06-15 15:52:33 +02:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- /bin/bash ci-scripts/manifest.sh "${BUILD_META}" "multi" "${DOCKERHUB_REVERT}" "${REVERT_IS_ROLLING}"
|
2023-06-15 15:52:33 +02:00
|
|
|
only:
|
2023-07-10 19:31:10 +02:00
|
|
|
variables:
|
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- BUILD_META: *MULTI_ARCH_BUILDS
|
2023-06-15 15:52:33 +02:00
|
|
|
|
2023-07-10 19:31:10 +02:00
|
|
|
dockerhub_revert_single:
|
|
|
|
stage: revert
|
2021-06-16 15:26:09 +02:00
|
|
|
script:
|
2023-07-10 19:31:10 +02:00
|
|
|
- /bin/bash ci-scripts/manifest.sh "${BUILD_META}" "single" "${DOCKERHUB_REVERT}" "${REVERT_IS_ROLLING}"
|
2021-06-16 15:26:09 +02:00
|
|
|
only:
|
|
|
|
variables:
|
2023-07-10 19:31:10 +02:00
|
|
|
- $DOCKERHUB_REVERT
|
|
|
|
- $REVERT_IS_ROLLING
|
2021-06-16 15:26:09 +02:00
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-07-10 19:31:10 +02:00
|
|
|
- BUILD_META: *SINGLE_ARCH_BUILDS
|