2021-01-18 20:12:23 +01:00
image : docker
services :
- docker:dind
2021-01-20 10:42:52 +01:00
variables :
2022-02-11 15:57:25 +01:00
KASMVNC_COMMIT_ID : $CI_COMMIT_SHA
2021-01-20 10:42:52 +01:00
GITLAB_SHARED_DIND_DIR : /builds/$CI_PROJECT_PATH/shared
2021-03-30 21:32:18 +02:00
GIT_SUBMODULE_STRATEGY : normal
2021-03-18 11:19:28 +01:00
GIT_FETCH_EXTRA_FLAGS : --tags
2022-02-11 15:57:25 +01:00
# E.g. BUILD_JOBS: build_debian_buster,build_ubuntu_bionic. This will include
# arm builds, because build_debian_buster_arm matches build_debian_buster.
# "BUILD_JOBS: none" won't build any build jobs, nor www.
BUILD_JOBS : all
2023-02-09 01:11:27 +01:00
DOCKER_HOST : unix://
2021-01-20 10:42:52 +01:00
2022-12-01 21:42:21 +01:00
workflow :
rules :
# Disable tag builds.
- if : $CI_COMMIT_TAG != $CI_COMMIT_REF_NAME
2021-01-18 20:12:23 +01:00
stages :
2021-10-19 21:44:36 +02:00
- www
2021-01-18 20:12:23 +01:00
- build
2022-08-19 19:54:11 +02:00
- test
2021-03-18 11:19:28 +01:00
- upload
2021-01-20 10:42:52 +01:00
2021-03-18 10:56:03 +01:00
.prepare_build : &prepare_build
- pwd
- apk add bash
- mkdir -p "$GITLAB_SHARED_DIND_DIR" && chmod 777 "$GITLAB_SHARED_DIND_DIR"
2021-10-19 21:44:36 +02:00
.prepare_www : &prepare_www
- tar -zxf output/www/kasm_www.tar.gz -C builder/
2021-03-18 11:17:52 +01:00
.prepare_artfacts : &prepare_artfacts
- cp -r builder/build/* output/
- rm output/*.tar.gz
2023-02-02 17:53:50 +01:00
default :
tags :
- oci-fixed-amd64
2021-10-19 21:44:36 +02:00
build_www :
stage : www
allow_failure : false
before_script :
- *prepare_build
script :
- webpacked_www=$PWD/builder/www
- src_www=kasmweb
- docker build -t kasmweb/www -f builder/dockerfile.www.build .
- docker run --rm -v $PWD/builder/www:/build kasmweb/www:latest
- mkdir -p output/www
- cd builder
2023-02-09 01:25:35 +01:00
- echo $PWD
- ls -l
- ls -l ../output
2021-10-19 21:44:36 +02:00
- tar -zcvf ../output/www/kasm_www.tar.gz www
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS !~ /^none$/
2021-10-19 21:44:36 +02:00
artifacts :
paths :
- output/
2021-03-18 11:19:28 +01:00
build_ubuntu_bionic :
2021-01-18 20:12:23 +01:00
stage : build
2021-09-24 00:49:52 +02:00
allow_failure : true
2021-03-18 10:56:03 +01:00
before_script :
- *prepare_build
2021-10-19 21:44:36 +02:00
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package ubuntu bionic
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-10-19 21:44:36 +02:00
artifacts :
paths :
- output/
build_ubuntu_bionic_arm :
stage : build
allow_failure : false
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2021-10-19 21:44:36 +02:00
before_script :
- *prepare_build
- *prepare_www
2021-03-18 11:17:52 +01:00
after_script :
- *prepare_artfacts
2021-01-18 20:12:23 +01:00
script :
2021-03-18 11:19:28 +01:00
- bash builder/build-package ubuntu bionic
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-01-18 20:12:23 +01:00
artifacts :
paths :
- output/
2021-03-18 11:19:28 +01:00
build_ubuntu_focal :
stage : build
2021-09-24 00:49:52 +02:00
allow_failure : true
2021-03-18 11:19:28 +01:00
before_script :
- *prepare_build
2021-10-19 21:44:36 +02:00
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package ubuntu focal;
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-10-19 21:44:36 +02:00
artifacts :
paths :
- output/
build_ubuntu_focal_arm :
stage : build
allow_failure : true
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2021-10-19 21:44:36 +02:00
before_script :
- *prepare_build
- *prepare_www
2021-03-18 11:19:28 +01:00
after_script :
- *prepare_artfacts
script :
- bash builder/build-package ubuntu focal;
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-03-18 11:19:28 +01:00
artifacts :
paths :
- output/
2022-06-08 12:46:03 +02:00
build_ubuntu_jammy :
stage : build
allow_failure : true
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package ubuntu jammy;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
build_ubuntu_jammy_arm :
stage : build
allow_failure : true
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2022-06-08 12:46:03 +02:00
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package ubuntu jammy;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
2021-03-18 11:19:28 +01:00
build_debian_buster :
stage : build
2021-09-24 00:49:52 +02:00
allow_failure : true
2021-03-18 11:19:28 +01:00
before_script :
- *prepare_build
2021-10-19 21:44:36 +02:00
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package debian buster;
2021-10-20 21:24:22 +02:00
only :
variables :
2023-02-13 19:39:26 +01:00
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-10-19 21:44:36 +02:00
artifacts :
paths :
- output/
build_debian_buster_arm :
stage : build
allow_failure : true
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2021-10-19 21:44:36 +02:00
before_script :
- *prepare_build
- *prepare_www
2021-03-18 11:19:28 +01:00
after_script :
- *prepare_artfacts
script :
- bash builder/build-package debian buster;
2021-10-20 21:24:22 +02:00
only :
variables :
2023-02-13 19:39:26 +01:00
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-03-18 11:19:28 +01:00
artifacts :
paths :
- output/
build_debian_bullseye :
stage : build
2021-09-24 00:49:52 +02:00
allow_failure : true
2021-03-18 11:19:28 +01:00
before_script :
- *prepare_build
2021-10-19 21:44:36 +02:00
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package debian bullseye;
2021-10-20 21:24:22 +02:00
only :
variables :
2023-02-13 19:39:26 +01:00
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-10-19 21:44:36 +02:00
artifacts :
paths :
- output/
build_debian_bullseye_arm :
stage : build
allow_failure : true
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2021-10-19 21:44:36 +02:00
before_script :
- *prepare_build
- *prepare_www
2021-03-18 11:19:28 +01:00
after_script :
- *prepare_artfacts
script :
- bash builder/build-package debian bullseye;
2021-10-20 21:24:22 +02:00
only :
variables :
2023-02-13 19:39:26 +01:00
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-03-18 11:19:28 +01:00
artifacts :
paths :
- output/
build_kali_rolling :
2021-01-18 20:12:23 +01:00
stage : build
2021-09-24 00:49:52 +02:00
allow_failure : true
2021-03-18 11:19:28 +01:00
before_script :
- *prepare_build
2021-10-19 21:44:36 +02:00
- *prepare_www
2021-03-18 11:19:28 +01:00
after_script :
- *prepare_artfacts
2021-01-18 20:12:23 +01:00
script :
2021-03-18 11:19:28 +01:00
- bash builder/build-package kali kali-rolling;
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-01-18 20:12:23 +01:00
artifacts :
paths :
- output/
2021-03-18 11:19:28 +01:00
2022-01-19 01:27:32 +01:00
build_kali_rolling_arm :
stage : build
allow_failure : true
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2022-01-19 01:27:32 +01:00
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package kali kali-rolling;
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2022-01-19 01:27:32 +01:00
artifacts :
paths :
- output/
2021-03-18 11:19:28 +01:00
build_centos7 :
stage : build
2021-09-24 00:49:52 +02:00
allow_failure : true
2021-03-18 11:19:28 +01:00
before_script :
- *prepare_build
2021-10-19 21:44:36 +02:00
- *prepare_www
2021-03-18 11:19:28 +01:00
after_script :
- *prepare_artfacts
script :
- bash builder/build-package centos core
2022-02-11 15:57:25 +01:00
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
2021-03-18 11:19:28 +01:00
artifacts :
paths :
- output/
2022-03-26 20:49:18 +01:00
build_oracle_8 :
stage : build
allow_failure : true
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package oracle 8;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
build_oracle_8_arm :
stage : build
allow_failure : true
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2022-03-26 20:49:18 +01:00
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package oracle 8;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
2023-03-03 12:09:08 +01:00
build_oracle_9 :
stage : build
allow_failure : true
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package oracle 9;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
build_oracle_9_arm :
stage : build
allow_failure : true
tags :
- oci-fixed-arm64
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package oracle 9;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
2022-04-04 18:31:55 +02:00
build_opensuse_15 :
stage : build
allow_failure : true
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package opensuse 15;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
build_opensuse_15_arm :
stage : build
allow_failure : true
tags :
2023-02-09 03:11:25 +01:00
- oci-fixed-arm64
2022-04-04 18:31:55 +02:00
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package opensuse 15;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
2023-02-24 13:02:28 +01:00
build_fedora_thirtyseven :
stage : build
allow_failure : true
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package fedora thirtyseven;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
build_fedora_thirtyseven_arm :
stage : build
allow_failure : true
tags :
- oci-fixed-arm64
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package fedora thirtyseven;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
2023-03-03 12:09:08 +01:00
build_alpine_317 :
stage : build
allow_failure : true
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package alpine 317;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
build_alpine_317_arm :
stage : build
allow_failure : true
tags :
- oci-fixed-arm64
before_script :
- *prepare_build
- *prepare_www
after_script :
- *prepare_artfacts
script :
- bash builder/build-package alpine 317;
only :
variables :
- $BUILD_JOBS == 'all' || $BUILD_JOBS =~ $CI_JOB_NAME
artifacts :
paths :
- output/
2022-08-19 19:54:11 +02:00
test :
stage : test
before_script :
- *prepare_build
script :
- bash builder/test-vncserver
2021-03-18 11:19:28 +01:00
upload :
stage : upload
image : ubuntu:focal
before_script :
- . .ci/upload.sh
script :
- prepare_to_run_scripts_and_s3_uploads
2022-02-11 15:57:25 +01:00
- S3_CRASHPAD_BUILD_DIRECTORY="kasmvnc/crashpad/${CI_COMMIT_SHA}"
- for dbgsym_package in `find output/ -type f -name '*dbgsym*deb'`; do
deb_package=$(find_deb_package "$dbgsym_package");
xvnc_md5sum=$(fetch_xvnc_md5sum "$deb_package");
upload_filename="${S3_CRASHPAD_BUILD_DIRECTORY}/${xvnc_md5sum}/kasmvncserver-dbgsym.deb";
echo;
echo "File to upload $upload_filename";
upload_to_s3 "$dbgsym_package" "$upload_filename" "$S3_BUCKET";
rm "$dbgsym_package";
done
- export S3_BUILD_DIRECTORY="kasmvnc/${CI_COMMIT_SHA}"
2021-03-18 11:19:28 +01:00
- export RELEASE_VERSION=$(.ci/next_release_version "$CI_COMMIT_REF_NAME")
2023-03-03 12:09:08 +01:00
- for package in `find output/ -type f -name '*.deb' -or -name '*.rpm' -or -name '*.tgz'`; do
2021-03-18 11:19:28 +01:00
prepare_upload_filename "$package";
2022-02-11 15:57:25 +01:00
upload_filename="${S3_BUILD_DIRECTORY}/$upload_filename";
2021-03-18 11:19:28 +01:00
echo;
echo "File to upload $upload_filename";
2022-02-11 15:57:25 +01:00
upload_to_s3 "$package" "$upload_filename" "$S3_BUCKET";
2023-03-03 12:09:08 +01:00
UPLOAD_NAME=$(basename $upload_filename | sed 's#kasmvncserver_##' | sed -r 's#_([0-9]{1,3}\.){2}[0-9]{1,2}_\S+?([a-f0-9]{6})##' | sed -r 's#\.(deb|rpm|tgz)##');
2021-10-20 21:24:22 +02:00
curl --request POST --header "PRIVATE-TOKEN:${GITLAB_API_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/statuses/${CI_COMMIT_SHA}?state=success&name=${UPLOAD_NAME}&target_url=${S3_URL}";
2021-03-18 11:19:28 +01:00
done