From c31d6f1de875a6b033fddbd56dcfdafc0c6be43b Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 23 Jan 2021 00:44:30 +0200
Subject: [PATCH] Common, selective jobs based on the branch.

To have a common .gitlab-ci.yml.
---
 .gitlab-ci.yml | 42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0017ecc..6016f1d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,15 +10,41 @@ stages:
   - build
   - deploy
 
-build:
+# FIXME: Remove duplicate jobs once
+# https://gitlab.com/gitlab-org/gitlab/-/issues/35742 is resolved.
+
+build-ns4:
+  extends: .compose-build
+  tags: [ns4.shore.co.il]
+  only:
+    - ns4
+
+run-ns4:
+  extends: .compose-run
+  tags: [ns4.shore.co.il]
+  only:
+    - ns4
+
+build-host01:
   extends: .compose-build
-  tags: ["${CI_COMMIT_BRANCH}.shore.co.il"]
-  except:
-    - master
+  tags: [host01.shore.co.il]
+  only:
+    - host01
+
+run-host01:
+  extends: .compose-run
+  tags: [host01.shore.co.il]
+  only:
+    - host01
 
+build-kodi:
+  extends: .compose-build
+  tags: [kodi.shore.co.il]
+  only:
+    - kodi
 
-run:
+run-kodi:
   extends: .compose-run
-  tags: ["${CI_COMMIT_BRANCH}.shore.co.il"]
-  except:
-    - master
+  tags: [kodi.shore.co.il]
+  only:
+    - kodi
-- 
GitLab