[damned-lies/develop] Exclude jobs from scheduled pipelines



commit 744811e4ac10a0ff0c333e656f476b51cd6b5ac1
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date:   Mon Sep 5 11:58:17 2022 +0200

    Exclude jobs from scheduled pipelines

 .gitlab-ci.yml | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7652419c..0478590d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -70,6 +70,10 @@ variables:
     expire_in: 3 hours
     when: on_success
 
+.exclude_job_from_scheduled_pipeline:
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule"
+      when: never
 
 ##############################################################################
 ###################             Pre Build                  ###################
@@ -105,7 +109,9 @@ build_damned_lies_runtime:
 ##############################################################################
 pages:
   stage: build
-  extends: .job-on-runtime-image
+  extends:
+    - .job-on-runtime-image
+    - .exclude_job_from_scheduled_pipeline
   script:
     - pip install -r ./docs/requirements.txt
     - make -C docs html
@@ -126,7 +132,9 @@ pages:
 
 package:
   stage: build
-  extends: .job-on-runtime-image
+  extends:
+    - .job-on-runtime-image
+    - .exclude_job_from_scheduled_pipeline
   script:
     - pip install build
     - python -m build
@@ -138,7 +146,9 @@ package:
 
 
 build_container:production:
-  extends: .build_damned_lies_image
+  extends:
+    - .build_damned_lies_image
+    - .exclude_job_from_scheduled_pipeline
   stage: build
   rules:
     - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
@@ -147,7 +157,9 @@ build_container:production:
 
 
 build_container:test:
-  extends: .build_damned_lies_image
+  extends:
+    - .build_damned_lies_image
+    - .exclude_job_from_scheduled_pipeline
   stage: build
   variables:
     KIND_OF_DEPLOYMENT: "test"
@@ -163,7 +175,9 @@ build_container:test:
 ##############################################################################
 test:
   stage: test
-  extends: .job-on-runtime-image
+  extends:
+    - .job-on-runtime-image
+    - .exclude_job_from_scheduled_pipeline
   dependencies: []
   allow_failure: true
   script:
@@ -190,6 +204,7 @@ test:
 
 .static-analysis:
   stage: test
+  extends: .exclude_job_from_scheduled_pipeline
   dependencies: []
   allow_failure: true
 
@@ -232,7 +247,9 @@ static-analysis:flake8:
 #############################################################################
 
 .deploy:
-  extends: .job-on-buildah
+  extends:
+    - .job-on-buildah
+    - .exclude_job_from_scheduled_pipeline
   before_script:
     - buildah login --username "${OCI_REGISTRY_USER}" --password "${OCI_REGISTRY_PASSWORD}" "${OCI_REGISTRY}"
   script:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]