mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-12 17:26:22 +00:00
ci: add scheduled builds
This commit is contained in:
@@ -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
|
||||
|
||||
33
.gitlab/schedules.gitlab-ci.yml
Normal file
33
.gitlab/schedules.gitlab-ci.yml
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user