From aa11e33a1715c84258dd9fc737f8d83aed019c99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de>
Date: Fri, 11 Oct 2024 15:43:12 +0200
Subject: [PATCH] test: make pipeline jobs interruptible if a newer commit
 comes in

---
 .gitlab-ci.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 036667c..ffde959 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,6 +8,7 @@ stages:          # List of stages for jobs, and their order of execution
   - test
 
 default:
+  interruptible: true
   before_script:
     - source /opt/molecule/bin/activate
     - ansible --version
@@ -23,6 +24,10 @@ default:
     - source /opt/molecule/bin/activate
     - molecule destroy --scenario-name ${SCENARIO}
 
+workflow:
+  auto_cancel:
+    on_new_commit: interruptible
+
 variables:
   SCENARIO: "default"
   # ANSIBLE_VAULT_PASSWORD_FILE: "molecule/lza_server_hardening.pass"
-- 
GitLab