From 161cd9e5790f1e53871ccec796bbc4c2b15bf329 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 12:22:51 +0000 Subject: [PATCH 1/3] added ci automation with inheritance --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ Dockerfile.oasapi => Dockerfile | 0 2 files changed, 26 insertions(+) create mode 100644 .gitlab-ci.yml rename Dockerfile.oasapi => Dockerfile (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..18e0625 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +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 + + - 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.oasapi b/Dockerfile similarity index 100% rename from Dockerfile.oasapi rename to Dockerfile -- GitLab From 486164f9f1967050b6a31aeeea42db565b2ec242 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 12:25:52 +0000 Subject: [PATCH 2/3] added configuration for mvn registry --- ci_settings.xml | 16 ++++++++++++++++ pom.xml | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ci_settings.xml diff --git a/ci_settings.xml b/ci_settings.xml new file mode 100644 index 0000000..69ad06e --- /dev/null +++ b/ci_settings.xml @@ -0,0 +1,16 @@ + + + + gitlab-maven + + + + Job-Token + ${CI_JOB_TOKEN} + + + + + + diff --git a/pom.xml b/pom.xml index 5d5a49d..0a3a11e 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,23 @@ 1.18.28 + + + gitlab-maven + https://labs.etsi.org/rep/api/v4/groups/260/-/packages/maven + + + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + + -- GitLab From d1d937e375ec3aab2eee95e14c490708366e293d Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 13:50:43 +0000 Subject: [PATCH 3/3] 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