From dc3e2c44468c00eb93ff853551d838b56baf0e43 Mon Sep 17 00:00:00 2001
From: "Rustam Lotsmanenko (EPAM)" <rustam_lotsmanenko@epam.com>
Date: Tue, 17 Dec 2024 16:01:13 +0000
Subject: [PATCH] Gradual Transition to One CI/CD Pipeline

---
 .gitlab-ci.yml                         | 15 ++++++++-
 devops/gc/pipeline/override-stages.yml |  4 +--
 pom.xml                                | 43 ++++++++++++++++++++------
 3 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d56a3f62b..8e05c46ca 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,8 +27,8 @@ variables:
   # We exclude it here to speed up pipeline execution, and avoid having the image fail on our Maven builds
   # Maven jobs should be using semgrep instead
   SAST_EXCLUDED_ANALYZERS: "spotbugs"
-  
   ACCEPTANCE_TEST_DIR: "legal-acceptance-test"
+
 include:
   - project: "osdu/platform/ci-cd-pipelines"
     file: "standard-setup.yml"
@@ -60,6 +60,18 @@ include:
   - project: "osdu/platform/ci-cd-pipelines"
     file: "cloud-providers/core-global.yml"
 
+  - project: "osdu/platform/ci-cd-pipelines"
+    file: "cloud-providers/aws-one-pipeline.yml"
+
+  - project: "osdu/platform/ci-cd-pipelines"
+    file: "cloud-providers/azure-one-pipeline.yml"
+
+  - project: "osdu/platform/ci-cd-pipelines"
+    file: "cloud-providers/gc-one-pipeline.yml"
+
+  - project: "osdu/platform/ci-cd-pipelines"
+    file: "cloud-providers/ibm-one-pipeline.yml"
+
   - local: "devops/gc/pipeline/override-stages.yml"
 
   - local: "devops/core-plus/pipeline/override-stages.yml"
@@ -196,6 +208,7 @@ azure_deploy:
     AZURE_COVERAGE_THRESHOLD: 80
 
 azure_containerize:
+  needs: [ "azure-compile-and-unit-test" ]
   variables:
     AZURE_CONTAINERIZE_REPOSITORY: "-b jdk-17 https://gitlab-ci-token:${CI_JOB_TOKEN}@community.opengroup.org/osdu/platform/deployment-and-operations/base-containers-azure/service-base-image"
 
diff --git a/devops/gc/pipeline/override-stages.yml b/devops/gc/pipeline/override-stages.yml
index 8285428f1..d4fdda864 100644
--- a/devops/gc/pipeline/override-stages.yml
+++ b/devops/gc/pipeline/override-stages.yml
@@ -82,7 +82,7 @@ download_gc_plugins:
       - $GC == '1'
 
 gc-containerize-gitlab:
-  needs: ["compile-and-unit-test", "download_gc_plugins"]
+  needs: ["gc-compile-and-unit-test", "download_gc_plugins"]
 
 gc-containerize-gcr:
-  needs: ["compile-and-unit-test", "download_gc_plugins"]
+  needs: ["gc-compile-and-unit-test", "download_gc_plugins"]
diff --git a/pom.xml b/pom.xml
index 3cdad1b4f..61d7229ca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,15 +34,6 @@
     <name>legal-service</name>
     <description>Legal service</description>
 
-    <modules>
-        <module>legal-core</module>
-        <module>legal-core-plus</module>
-        <module>provider/legal-gc</module>
-        <module>provider/legal-azure</module>
-        <module>provider/legal-aws</module>
-        <module>provider/legal-ibm</module>
-    </modules>
-
     <repositories>
         <repository>
             <id>${repo.releases.id}</id>
@@ -150,6 +141,40 @@
         </dependency>
 		</dependencies>
     <profiles>
+        <profile>
+            <id>core</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <modules>
+                <module>legal-core</module>
+                <module>legal-core-plus</module>
+            </modules>
+        </profile>
+        <profile>
+            <id>aws</id>
+            <modules>
+                <module>provider/legal-aws</module>
+            </modules>
+        </profile>
+        <profile>
+            <id>azure</id>
+            <modules>
+                <module>provider/legal-azure</module>
+            </modules>
+        </profile>
+        <profile>
+            <id>ibm</id>
+            <modules>
+                <module>provider/legal-ibm</module>
+            </modules>
+        </profile>
+        <profile>
+            <id>gc</id>
+            <modules>
+                <module>provider/legal-gc</module>
+            </modules>
+        </profile>
         <profile>
             <id>Default</id>
             <activation>
-- 
GitLab