Skip to contentSkip to conversation

ci: Trigger xenomai-images child pipeline corresponding to main branches

PATCH New Jan Kiszka 1 participant 1 message May 12, 2021

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 ci: Trigger xenomai-images child pipeline corresponding to main branches

From: Jan Kiszka <[email protected]>

This couples pushing to next and stable branches with running xenomai-images, and then only the affected child pipeline. Precondition is setting XENOMAI_IMAGES_TOKEN as protected CI/CD variable.

---
 .gitlab-ci.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)
.gitlab-ci.yml +13 -0
index d8dc67f682..f6d2ee8843 100644
@@ -10,6 +10,7 @@
 
 stages:
   - build
+  - test
 
 default:
   image: debian:buster
@@ -26,6 +27,7 @@ variables:
   PACKAGES_arm64: "gcc-8-aarch64-linux-gnu libc6-dev-arm64-cross"
   PACKAGES_powerpc: "gcc-8-powerpc-linux-gnu libc6-dev-powerpc-cross"
   PACKAGES_x86: ""
+  XENOMAI_IMAGES_BRANCH: "master"
 
 .build:
   stage: build
@@ -231,3 +233,14 @@ powerpc-4.19-release:
     PIPELINE_REV: ipipe-core-4.19..*-ppc32-.*
     PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-ppc32.git
     KERNEL_DEFCONFIG: mpc5200_defconfig
+
+trigger-xenomai-images:
+  stage: test
+  image: curlimages/curl
+  script:
+    - curl -X POST -F "token=${XENOMAI_IMAGES_TOKEN}"
+           -F "ref=${XENOMAI_IMAGES_BRANCH}"
+           -F "variables[ONLY_RUN]=${CI_COMMIT_BRANCH}"
+           https://source.denx.de/api/v4/projects/479/trigger/pipeline
+  rules:
+    - if: '$XENOMAI_IMAGES_TOKEN != "" && ($CI_COMMIT_BRANCH == "next" || $CI_COMMIT_BRANCH =~ /stable\/.*/)'
Signature · 1 line
2.26.2