From 1e8df87ab1f0a11b119ae6866bba63239de3e511 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 12:13:11 +0000 Subject: [PATCH 1/4] refactored ci code to use inheritance --- .gitlab-ci.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db0ad64..8a64474 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,9 @@ -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 -deploy: - stage: deploy - image: maven:3.9.5-ibm-semeru-17-focal - script: - - mvn deploy -s ci_settings.xml -DskipTests +docker_build: + extends: .docker_build -- GitLab From d7408455f7b8ad39acff8a5b0209e4c7dda866ac Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 12:14:15 +0000 Subject: [PATCH 2/4] renamed --- Dockerfile.portalapi => Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Dockerfile.portalapi => Dockerfile (100%) diff --git a/Dockerfile.portalapi b/Dockerfile similarity index 100% rename from Dockerfile.portalapi rename to Dockerfile -- GitLab From 651b77ce936866aae3a8434308dbf7024fda9989 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 12:15:03 +0000 Subject: [PATCH 3/4] added mvn build job --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a64474..18e0625 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,23 @@ include: file: - ci-templates/default.yml - ci-templates/build.yml + only: + - main + - develop + + - 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 -- GitLab From b1b6c87fe17632dc9bc0df6556756c2ea82237f3 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 13:50:37 +0000 Subject: [PATCH 4/4] 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