ci: add scheduled builds

This commit is contained in:
Rainer Killinger
2023-07-11 16:10:29 +02:00
parent 107a7c5e9e
commit 982b4feb3c
23 changed files with 2266 additions and 1948 deletions

View File

@@ -1,6 +1,6 @@
---
'@openstapps/projectmanagement': major
'@openstapps/node-image': major
'@openstapps/node-base': major
---
Move images to separate packages

View File

@@ -10,6 +10,7 @@
include:
- local: /backend/backend/.gitlab-ci.yml
- local: /frontend/app/.gitlab-ci.yml
- local: /.gitlab/schedules.gitlab-ci.yml
- local: /.gitlab/publishing.gitlab-ci.yml
rules:
- if: '$CI_COMMIT_MESSAGE =~ /ci: publish release$/'
@@ -25,7 +26,7 @@ variables:
description: Bypass turbo cache
default:
image: registry.gitlab.com/openstapps/projectmanagement/builder:v18
image: registry.gitlab.com/openstapps/openstapps/node-builder
tags:
- performance
interruptible: true
@@ -45,6 +46,7 @@ default:
policy: pull
stages:
- setup
- build
- test
- audit
@@ -95,7 +97,7 @@ stop review:
rules: *deploy-rules
unit:
image: registry.gitlab.com/openstapps/app:v18
image: registry.gitlab.com/openstapps/openstapps/app-builder
stage: test
needs: ['build']
script:
@@ -103,10 +105,13 @@ unit:
# - pnpm i --prefer-offline
# - pnpm test:skip || pnpm i -r --prefer-offline
- pnpm install
- cd node_modules/.pnpm/re2*/node_modules/re2
- npm run install
- cd $CI_PROJECT_DIR
- pnpm test $TURBO_CACHE_BYPASS
coverage: '/Statements[^:]*\:[^:]*\s+([\d\.]+)%/'
artifacts:
when: always
when: on_failure
paths:
- report-junit.xml
- coverage.xml

View File

@@ -1,15 +1,18 @@
.limit_publishing:
- if: $CI_PIPELINE_SOURCE != "schedule"
when: on_success
deploy:
stage: publish
needs: ['build', 'unit', 'integration', 'e2e']
needs: ['build', 'unit', 'integration', 'e2e', 'audit']
script:
- pnpm install
- pnpm run deploy
artifacts:
paths:
- ./.deploy
- ./.deploy #TODO: split artifacts (keep frontend, fast expire .deploy)
- ./frontend/app/www
rules:
- when: on_success
rules: !reference [.limit_publishing]
publish image:
stage: publish
@@ -18,7 +21,7 @@ publish image:
- tags
needs: ['deploy']
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
name: gcr.io/kaniko-project/executor:v1.12.1-debug
entrypoint: [""]
script:
- >
@@ -26,8 +29,8 @@ publish image:
--context "${CI_PROJECT_DIR}/${DEPLOY_DIR}"
--dockerfile "${CI_PROJECT_DIR}/${DEPLOY_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
rules:
- when: on_success
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:latest"
rules: !reference [.limit_publishing]
parallel:
matrix:
- IMAGE_NAME: database
@@ -42,10 +45,6 @@ publish image:
DEPLOY_DIR: .deploy/minimal-connector
- IMAGE_NAME: minimal-plugin
DEPLOY_DIR: .deploy/minimal-plugin
- IMAGE_NAME: node
DEPLOY_DIR: configuration/node-image
- IMAGE_NAME: app-builder
DEPLOY_DIR: configuration/app-builder-image
- IMAGE_NAME: app
DEPLOY_DIR: frontend/app
@@ -78,5 +77,3 @@ publish docs:
artifacts:
paths:
- public
rules:
- when: on_success

View File

@@ -0,0 +1,33 @@
.limit_base_image_publishing:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == 'main'
when: always
base image:
image: docker
stage: setup
tags:
- gitlab-org-docker
inherit:
default:
- interruptible
services:
- docker:dind
script:
- >
docker login -u "${CI_REGISTRY_USER}" -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}" &&
docker build
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:latest" "${CI_PROJECT_DIR}/${DEPLOY_DIR}" &&
docker push "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}"
cache: {} # disable irrelevant cache for this job
before_script: [] # do not run irrelevant before script for this job
rules: !reference [.limit_base_image_publishing]
parallel:
matrix:
- IMAGE_NAME: node-base
DEPLOY_DIR: images/node-base
- IMAGE_NAME: node-builder
DEPLOY_DIR: images/node-builder
- IMAGE_NAME: app-builder
DEPLOY_DIR: images/app-builder

View File

@@ -1,18 +1,18 @@
integration:
image: registry.gitlab.com/openstapps/projectmanagement/builder:v18
image: registry.gitlab.com/openstapps/openstapps/node-builder
stage: test
needs: ['build']
variables:
DOCKER_DRIVER: overlay2
WAIT_FOR_SERVICES_TIMEOUT: 1
services:
- name: registry.gitlab.com/openstapps/database:latest
- name: registry.gitlab.com/openstapps/openstapps/database:latest
alias: elasticsearch
script:
- pnpm --filter=@openstapps/backend install
- pnpm test:integration:backend
artifacts:
when: always
when: on_failure
paths:
- backend/backend/coverage/integration-report-junit.xml
reports:

View File

@@ -1,4 +1,4 @@
FROM registry.gitlab.com/openstapps/projectmanagement/node:v18
FROM registry.gitlab.com/openstapps/openstapps/node-base
USER root
RUN apk add --update python3 py3-pip make g++ gcompat

View File

@@ -1,4 +1,4 @@
FROM registry.gitlab.com/openstapps/projectmanagement/node
FROM registry.gitlab.com/openstapps/openstapps/node-base
USER root

View File

@@ -1,4 +1,4 @@
FROM registry.gitlab.com/openstapps/projectmanagement/node:v18
FROM registry.gitlab.com/openstapps/openstapps/node-base
WORKDIR /minimal-connector
ENTRYPOINT ["node", "lib/cli.js", "run", "--"]

View File

@@ -1,4 +1,4 @@
FROM registry.gitlab.com/openstapps/projectmanagement/node:v18
FROM registry.gitlab.com/openstapps/openstapps/node-base
WORKDIR /app
ENTRYPOINT ["node", "lib/cli.js"]

View File

@@ -1,4 +1,4 @@
FROM registry.gitlab.com/openstapps/app
FROM registry.gitlab.com/openstapps/openstapps/app
ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8

View File

@@ -6,7 +6,7 @@ e2e:
- pnpm --filter=@openstapps/app exec cypress install
- pnpm test:integration:app
artifacts:
when: always
when: on_failure #TODO: expire artifacts / only keep if job failed etc.
paths:
- frontend/app/cypress/videos
- frontend/app/cypress/screenshots

View File

@@ -8,7 +8,7 @@ LABEL version="2.0.0" \
### Configure versions to install
ENV ANDROID_APIS="android-30" \
ANDROID_BUILD_TOOLS_VERSION="30.0.2" \
NPM_VERSION="^6.0.0" \
NPM_VERSION="^9.0.0" \
IONIC_VERSION="^6.0.0" \
CORDOVA_RES_VERSION="latest" \
### Configure download URLs
@@ -51,11 +51,12 @@ RUN apt-get update && \
wget \
gpg-agent \
jq \
musl-dev \
&& rm -rf /var/lib/apt/lists/*
### Install Java Development Kit 11
### Install Java Development Kit 17
RUN add-apt-repository -y ppa:openjdk-r/ppa && apt-get update && \
apt-get install --no-install-recommends -y openjdk-11-jdk \
apt-get install --no-install-recommends -y openjdk-17-jdk \
&& rm -rf /var/lib/apt/lists/*
### Setup the locale
@@ -108,6 +109,10 @@ RUN cd / && ionic start $TMP_PROJECT_NAME blank --type=angular --capacitor --no-
cd android && ./gradlew assembleDebug && \
cd / && rm -rf $TMP_PROJECT_NAME
### Compatibility with musl libc
RUN ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
### Set working directory
WORKDIR /app

View File

@@ -3,14 +3,14 @@
# Discussion, issues and change requests at:
# https://github.com/nodesource/distributions
#
# Script to install the NodeSource Node.js 14.x repo onto a
# Script to install the NodeSource Node.js 18.x repo onto a
# Debian or Ubuntu system.
#
# Run as root or insert `sudo -E` before `bash`:
#
# curl -sL https://deb.nodesource.com/setup_14.x | bash -
# curl -sL https://deb.nodesource.com/setup_18.x | bash -
# or
# wget -qO- https://deb.nodesource.com/setup_14.x | bash -
# wget -qO- https://deb.nodesource.com/setup_18.x | bash -
#
# CONTRIBUTIONS TO THIS SCRIPT
#
@@ -21,9 +21,9 @@
export DEBIAN_FRONTEND=noninteractive
SCRSUFFIX="_14.x"
NODENAME="Node.js 14.x"
NODEREPO="node_14.x"
SCRSUFFIX="_18.x"
NODENAME="Node.js 18.x"
NODEREPO="node_18.x"
NODEPKG="nodejs"
print_status() {
@@ -95,8 +95,11 @@ node_deprecation_warning() {
"X${NODENAME}" == "XNode.js 9.x" ||
"X${NODENAME}" == "XNode.js 10.x" ||
"X${NODENAME}" == "XNode.js 11.x" ||
"X${NODENAME}" == "XNode.js 12.x" ||
"X${NODENAME}" == "XNode.js 13.x" ||
"X${NODENAME}" == "XNode.js 15.x" ]]; then
"X${NODENAME}" == "XNode.js 14.x" ||
"X${NODENAME}" == "XNode.js 15.x" ||
"X${NODENAME}" == "XNode.js 17.x" ]]; then
print_bold \
" DEPRECATION WARNING " "\
@@ -108,10 +111,10 @@ ${bold}${NODENAME} is no longer actively supported!${normal}
Use the installation script that corresponds to the version of Node.js you
wish to install. e.g.
* ${green}https://deb.nodesource.com/setup_12.x — Node.js 12 LTS \"Erbium\"${normal}
* ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 LTS \"Fermium\"${normal} (recommended)
* ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
* ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 \"Eighteen\"${normal} (current)
* ${green}https://deb.nodesource.com/setup_16.x Node.js 16 \"Gallium\"${normal}
* ${green}https://deb.nodesource.com/setup_18.x Node.js 18 LTS \"Hydrogen\"${normal} (recommended)
* ${green}https://deb.nodesource.com/setup_19.x Node.js 19 \"Nineteen\"${normal}
* ${green}https://deb.nodesource.com/setup_20.x Node.js 20 \"Iron\"${normal} (current)
Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
version may be appropriate for you.
@@ -138,10 +141,10 @@ This script, located at ${bold}https://deb.nodesource.com/setup${normal}, used t
You should use the script that corresponds to the version of Node.js you
wish to install. e.g.
* ${green}https://deb.nodesource.com/setup_12.x — Node.js 12 LTS \"Erbium\"${normal}
* ${green}https://deb.nodesource.com/setup_14.x — Node.js 14 LTS \"Fermium\"${normal} (recommended)
* ${green}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\"${normal}
* ${green}https://deb.nodesource.com/setup_17.x — Node.js 18 \"Eighteen\"${normal} (current)
* ${green}https://deb.nodesource.com/setup_16.x Node.js 16 \"Gallium\"${normal}
* ${green}https://deb.nodesource.com/setup_18.x Node.js 18 LTS \"Hydrogen\"${normal} (recommended)
* ${green}https://deb.nodesource.com/setup_19.x Node.js 19 \"Nineteen\"${normal}
* ${green}https://deb.nodesource.com/setup_20.x Node.js 20 \"Iron\"${normal} (current)
Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
version may be appropriate for you.
@@ -222,16 +225,36 @@ check_alt() {
fi
}
check_alt "SolydXK" "solydxk-9" "Debian" "stretch"
check_alt "Astra Linux" "orel" "Debian" "stretch"
check_alt "BOSS" "anokha" "Debian" "wheezy"
check_alt "BOSS" "anoop" "Debian" "jessie"
check_alt "BOSS" "drishti" "Debian" "stretch"
check_alt "BOSS" "unnati" "Debian" "buster"
check_alt "BOSS" "urja" "Debian" "bullseye"
check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
check_alt "bunsenlabs" "helium" "Debian" "stretch"
check_alt "bunsenlabs" "lithium" "Debian" "buster"
check_alt "Devuan" "jessie" "Debian" "jessie"
check_alt "Devuan" "ascii" "Debian" "stretch"
check_alt "Devuan" "beowulf" "Debian" "buster"
check_alt "Devuan" "chimaera" "Debian" "bullseye"
check_alt "Devuan" "ceres" "Debian" "sid"
check_alt "Devuan" "daedalus" "Debian" "bookworm"
check_alt "Deepin" "panda" "Debian" "sid"
check_alt "Deepin" "unstable" "Debian" "sid"
check_alt "Deepin" "stable" "Debian" "buster"
check_alt "Deepin" "apricot" "Debian" "buster"
check_alt "Deepin" "beige" "Debian" "bookworm"
check_alt "elementaryOS" "luna" "Ubuntu" "precise"
check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
check_alt "elementaryOS" "loki" "Ubuntu" "xenial"
check_alt "elementaryOS" "juno" "Ubuntu" "bionic"
check_alt "elementaryOS" "hera" "Ubuntu" "bionic"
check_alt "elementaryOS" "odin" "Ubuntu" "focal"
check_alt "elementaryOS" "jolnir" "Ubuntu" "focal"
check_alt "elementaryOS" "horus" "Ubuntu" "jammy"
check_alt "Kali" "sana" "Debian" "jessie"
check_alt "Kali" "kali-rolling" "Debian" "bullseye"
check_alt "Sparky Linux" "Tyche" "Debian" "stretch"
check_alt "Sparky Linux" "Nibiru" "Debian" "buster"
check_alt "Sparky Linux" "Po-Tolo" "Debian" "bullseye"
check_alt "MX Linux 17" "Horizon" "Debian" "stretch"
check_alt "MX Linux 18" "Continuum" "Debian" "stretch"
check_alt "MX Linux 19" "patito feo" "Debian" "buster"
check_alt "MX Linux 21" "wildflower" "Debian" "bullseye"
check_alt "Linux Mint" "maya" "Ubuntu" "precise"
check_alt "Linux Mint" "qiana" "Ubuntu" "trusty"
check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty"
@@ -249,45 +272,33 @@ check_alt "Linux Mint" "ulyana" "Ubuntu" "focal"
check_alt "Linux Mint" "ulyssa" "Ubuntu" "focal"
check_alt "Linux Mint" "uma" "Ubuntu" "focal"
check_alt "Linux Mint" "una" "Ubuntu" "focal"
check_alt "Linux Mint" "vanessa" "Ubuntu" "jammy"
check_alt "Linux Mint" "vera" "Ubuntu" "jammy"
check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch"
check_alt "LMDE" "betsy" "Debian" "jessie"
check_alt "LMDE" "cindy" "Debian" "stretch"
check_alt "LMDE" "debbie" "Debian" "buster"
check_alt "LMDE" "elsie" "Debian" "bullseye"
check_alt "elementaryOS" "luna" "Ubuntu" "precise"
check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
check_alt "elementaryOS" "loki" "Ubuntu" "xenial"
check_alt "elementaryOS" "juno" "Ubuntu" "bionic"
check_alt "elementaryOS" "hera" "Ubuntu" "bionic"
check_alt "elementaryOS" "odin" "Ubuntu" "focal"
check_alt "elementaryOS" "jolnir" "Ubuntu" "focal"
check_alt "MX Linux 17" "Horizon" "Debian" "stretch"
check_alt "MX Linux 18" "Continuum" "Debian" "stretch"
check_alt "MX Linux 19" "patito feo" "Debian" "buster"
check_alt "MX Linux 21" "wildflower" "Debian" "bullseye"
check_alt "Pardus" "onyedi" "Debian" "stretch"
check_alt "Parrot" "ara" "Debian" "bullseye"
check_alt "PureOS" "green" "Debian" "sid"
check_alt "PureOS" "amber" "Debian" "buster"
check_alt "PureOS" "byzantium" "Debian" "bullseye"
check_alt "SolydXK" "solydxk-9" "Debian" "stretch"
check_alt "Sparky Linux" "Tyche" "Debian" "stretch"
check_alt "Sparky Linux" "Nibiru" "Debian" "buster"
check_alt "Sparky Linux" "Po-Tolo" "Debian" "bullseye"
check_alt "Tanglu" "chromodoris" "Debian" "jessie"
check_alt "Trisquel" "toutatis" "Ubuntu" "precise"
check_alt "Trisquel" "belenos" "Ubuntu" "trusty"
check_alt "Trisquel" "flidas" "Ubuntu" "xenial"
check_alt "Trisquel" "etiona" "Ubuntu" "bionic"
check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial"
check_alt "BOSS" "anokha" "Debian" "wheezy"
check_alt "BOSS" "anoop" "Debian" "jessie"
check_alt "BOSS" "drishti" "Debian" "stretch"
check_alt "BOSS" "unnati" "Debian" "buster"
check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
check_alt "bunsenlabs" "helium" "Debian" "stretch"
check_alt "bunsenlabs" "lithium" "Debian" "buster"
check_alt "Tanglu" "chromodoris" "Debian" "jessie"
check_alt "PureOS" "green" "Debian" "sid"
check_alt "PureOS" "amber" "Debian" "buster"
check_alt "PureOS" "byzantium" "Debian" "bullseye"
check_alt "Devuan" "jessie" "Debian" "jessie"
check_alt "Devuan" "ascii" "Debian" "stretch"
check_alt "Devuan" "beowulf" "Debian" "buster"
check_alt "Devuan" "chimaera" "Debian" "bullseye"
check_alt "Devuan" "ceres" "Debian" "sid"
check_alt "Deepin" "panda" "Debian" "sid"
check_alt "Deepin" "unstable" "Debian" "sid"
check_alt "Deepin" "stable" "Debian" "buster"
check_alt "Pardus" "onyedi" "Debian" "stretch"
check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch"
check_alt "Astra Linux" "orel" "Debian" "stretch"
check_alt "Ubilinux" "dolcetto" "Debian" "stretch"
check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial"
if [ "X${DISTRO}" == "Xdebian" ]; then
print_status "Unknown Debian-based distribution, checking /etc/debian_version..."

View File

@@ -1,5 +1,5 @@
{
"name": "@openstapps/node-image",
"name": "@openstapps/node-base",
"version": "3.0.0-next.3",
"private": true,
"type": "module",

View File

@@ -0,0 +1,7 @@
FROM node:18-alpine
RUN apk update && apk add git jq curl python3 build-base
RUN npm install turbo pnpm --global
CMD []

View File

@@ -0,0 +1,20 @@
{
"name": "@openstapps/node-builder",
"version": "3.0.0-next.3",
"private": true,
"type": "module",
"license": "GPL-3.0-only",
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
"contributors": [
"Anselm Stordeur <anselmstordeur@gmail.com>",
"Jovan Krunić <jovan.krunic@gmail.com>",
"Michel Jonathan Schmitz",
"Rainer Killinger <mail-openstapps@killinger.co>",
"Thea Schöbl <dev@theaninova.de>"
],
"files": [
"Dockerfile",
"README.md",
"CHANGELOG.md"
]
}

View File

@@ -1,4 +1,4 @@
FROM registry.gitlab.com/openstapps/projectmanagement/node:v18
FROM registry.gitlab.com/openstapps/openstapps/node-base
USER root
RUN apk add --update python3 py3-pip make g++ gcompat

View File

@@ -62,7 +62,7 @@
"mustache": "4.2.0",
"openapi-types": "12.1.0",
"plantuml-encoder": "1.4.0",
"re2": "1.18.0",
"re2": "1.18.2",
"toposort": "2.0.2",
"ts-json-schema-generator": "1.2.0"
},

3905
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,3 +4,4 @@ packages:
- "examples/*"
- "frontend/*"
- "packages/*"
- "images/*"