1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-12 18:59:50 +03:00

ci: use dynamic downstream pipelines

This gives us more flexibiity with regards to the job configuration. One
job generates the job configuration which then triggers a downstream
pipeline.
This commit is contained in:
Kevin Daudt 2024-11-26 19:39:30 +00:00
parent 7256870fc7
commit 08d03b91a8
2 changed files with 28 additions and 2 deletions

View file

@ -7,10 +7,10 @@ variables:
GIT_DEPTH: "500"
REGISTRY: registry.alpinelinux.org
# only rune pipelines for merge requests or when tags are pushed (for triggers)
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "parent_pipeline"
- if: $CI_COMMIT_TAG
lint:
@ -26,6 +26,32 @@ lint:
- docker-alpine
- x86_64
generate-build-jobs:
stage: verify
image:
name: $REGISTRY/alpine/infra/docker/alpine-gitlab-ci:latest
script:
- pipeline generate .gitlab-ci.yml .gitlab/job-config.yaml >.gitlab/build-jobs.yaml
artifacts:
paths:
- .gitlab/build-jobs.yaml
tags:
- docker-alpine
- x86_64
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
build-jobs:
stage: verify
needs:
- generate-build-jobs
trigger:
include:
- artifact: .gitlab/build-jobs.yaml
job: generate-build-jobs
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
.build:
stage: verify
image:
@ -41,7 +67,7 @@ lint:
expire_in: 1 day
when: always
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
build-x86_64:
extends: .build

0
.gitlab/job-config.yaml Normal file
View file