From aa2749b6ce4c256b1c3fd29c576cdb566720a6b8 Mon Sep 17 00:00:00 2001
From: "vihar.mamania" <vihar.mamania@bp.com>
Date: Wed, 12 Feb 2025 16:04:45 +0530
Subject: [PATCH] Moving to single CI/CD pipeline

---
 .gitlab-ci.yml                                | 15 ++++++-
 pom.xml                                       | 43 +++++++++++++++----
 provider/storage-aws/build-aws/buildspec.yaml |  4 +-
 storage-acceptance-test/pom.xml               |  2 +-
 testing/storage-test-baremetal/pom.xml        |  2 +-
 5 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bf16bb44f..a1859a037 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -64,8 +64,21 @@ include:
   - project: "osdu/platform/ci-cd-pipelines"
     file: "cloud-providers/ibm.yml"
 
-  - local: "devops/gc/pipeline/override-stages.yml"
   - local: "devops/core-plus/pipeline/override-stages.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: "/publish.yml"
 
 # disable the eslint scanner
diff --git a/pom.xml b/pom.xml
index 9b333d34b..947ff7f82 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,15 +30,6 @@
       </license>
     </licenses>
 
-    <modules>
-      <module>storage-core</module>
-      <module>storage-core-plus</module>
-      <module>provider/storage-aws</module>
-      <module>provider/storage-azure</module>
-      <module>provider/storage-gc</module>
-      <module>provider/storage-ibm</module>
-    </modules>
-
     <properties>
       <java.version>17</java.version>
       <maven.compiler.target>17</maven.compiler.target>
@@ -232,6 +223,40 @@
           </publish.releases.url>
         </properties>
       </profile>
+      <profile>
+        <id>core</id>
+        <activation>
+          <activeByDefault>true</activeByDefault>
+        </activation>
+        <modules>
+          <module>storage-core</module>
+          <module>storage-core-plus</module>
+        </modules>
+      </profile>
+      <profile>
+        <id>aws</id>
+        <modules>
+          <module>provider/storage-aws</module>
+        </modules>
+      </profile>
+      <profile>
+        <id>azure</id>
+        <modules>
+          <module>provider/storage-azure</module>
+        </modules>
+      </profile>
+      <profile>
+        <id>ibm</id>
+        <modules>
+          <module>provider/storage-ibm</module>
+        </modules>
+      </profile>
+      <profile>
+        <id>gc</id>
+        <modules>
+          <module>provider/storage-gc</module>
+        </modules>
+      </profile>
     </profiles>
 
     <repositories>
diff --git a/provider/storage-aws/build-aws/buildspec.yaml b/provider/storage-aws/build-aws/buildspec.yaml
index 5cc73f990..d46366c77 100644
--- a/provider/storage-aws/build-aws/buildspec.yaml
+++ b/provider/storage-aws/build-aws/buildspec.yaml
@@ -73,8 +73,8 @@ phases:
       - if [ "$GIT_SECRETS_SCAN_RESULT" = "FAILED" ]; then echo "Secrets detected!" && exit 1; fi
 
       - echo "Building primary service assemblies..."
-      - mvn -ntp -B test install -pl .,storage-core,provider/storage-aws -Ddeployment.environment=prod
-      - mvn sonar:sonar -pl .,provider/storage-aws -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.host.url=${SONAR_URL}
+      - mvn -ntp -B test install -pl .,storage-core,provider/storage-aws -P core,aws -Ddeployment.environment=prod
+      - mvn sonar:sonar -pl .,provider/storage-aws -P aws -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.host.url=${SONAR_URL}
       - echo "Building integration testing assemblies and gathering artifacts..."
       - ./testing/storage-test-aws/build-aws/prepare-dist.sh
 
diff --git a/storage-acceptance-test/pom.xml b/storage-acceptance-test/pom.xml
index 997268ec1..d660b7a7c 100644
--- a/storage-acceptance-test/pom.xml
+++ b/storage-acceptance-test/pom.xml
@@ -123,7 +123,7 @@
         <dependency>
             <groupId>com.nimbusds</groupId>
             <artifactId>oauth2-oidc-sdk</artifactId>
-            <version>9.15</version>
+            <version>10.15</version>
         </dependency>
     </dependencies>
 
diff --git a/testing/storage-test-baremetal/pom.xml b/testing/storage-test-baremetal/pom.xml
index 3c08dcaa9..af86b2ecb 100644
--- a/testing/storage-test-baremetal/pom.xml
+++ b/testing/storage-test-baremetal/pom.xml
@@ -46,7 +46,7 @@
         <dependency>
             <groupId>com.nimbusds</groupId>
             <artifactId>oauth2-oidc-sdk</artifactId>
-            <version>9.15</version>
+            <version>10.15</version>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
-- 
GitLab