From c03675aaa6c2a445c69867d137002c71fb0ecc44 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 12:32:16 +0000 Subject: [PATCH 1/2] refactored ci to use inheritance --- .gitlab-ci.yml | 32 ++++++++++++++++++++++++------- Dockerfile.bugzilla => Dockerfile | 0 2 files changed, 25 insertions(+), 7 deletions(-) rename Dockerfile.bugzilla => Dockerfile (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db0ad64..18e0625 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,26 @@ -stages: - - deploy +include: + - project: osl/code/org.etsi.osl.main + ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + file: + - ci-templates/default.yml + - ci-templates/build.yml + only: + - main + - develop -deploy: - stage: deploy - image: maven:3.9.5-ibm-semeru-17-focal - script: - - mvn deploy -s ci_settings.xml -DskipTests + - project: osl/code/org.etsi.osl.main + ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + file: + - ci-templates/default.yml + - ci-templates/build_unprotected.yml + except: + - main + - develop + +maven_build: + extends: .maven_build + +docker_build: + extends: .docker_build + needs: + - maven_build diff --git a/Dockerfile.bugzilla b/Dockerfile similarity index 100% rename from Dockerfile.bugzilla rename to Dockerfile -- GitLab From ae2a3c8502985c2c8454e79ea8fc9d464c7e683b Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 13:50:55 +0000 Subject: [PATCH 2/2] used dynamic ref in inheritance --- .gitlab-ci.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18e0625..8ea78d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,21 +1,27 @@ include: - project: osl/code/org.etsi.osl.main - ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + ref: main file: - ci-templates/default.yml - ci-templates/build.yml - only: - - main - - develop + rules: + - if: '$CI_COMMIT_REF_NAME == "main"' + + - project: osl/code/org.etsi.osl.main + ref: develop + file: + - ci-templates/default.yml + - ci-templates/build.yml + rules: + - if: '$CI_COMMIT_REF_NAME == "develop"' - project: osl/code/org.etsi.osl.main - ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + ref: develop file: - ci-templates/default.yml - ci-templates/build_unprotected.yml - except: - - main - - develop + rules: + - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"' maven_build: extends: .maven_build -- GitLab