From 0806ef123373edb65461a6ea7d9d2cbb260df336 Mon Sep 17 00:00:00 2001
From: MUHAMMAD FAID LUQMAN BIN NOR HASNI <muhammad.f.norhasni@exxonmobil.com>
Date: Wed, 19 Feb 2025 08:28:34 +0800
Subject: [PATCH] Gradual transition to one CI pipeline

(cherry picked from commit a277c3803c44b64097107fe5ab5483315cd095e1)
---
 .gitlab-ci.yml                                |  4 +-
 devops/gc/pipeline/override-stages.yml        |  2 +-
 pom.xml                                       | 66 +++++++++++--------
 .../notification-aws/build-aws/buildspec.yaml |  4 +-
 4 files changed, 43 insertions(+), 33 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 12ed29892..ee45bbef8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -54,8 +54,8 @@ include:
     file: "cloud-providers/core-global.yml"
     ref: release/0.28
 
-  # aws
-  - local: "devops/aws/pipeline/override-stages.yml"
+    - project: "osdu/platform/ci-cd-pipelines"
+      file: "cloud-providers/aws-one-pipeline.yml"
 
   - local: "devops/gc/pipeline/override-stages.yml"
 
diff --git a/devops/gc/pipeline/override-stages.yml b/devops/gc/pipeline/override-stages.yml
index 133cecb33..d2e521f6b 100644
--- a/devops/gc/pipeline/override-stages.yml
+++ b/devops/gc/pipeline/override-stages.yml
@@ -23,7 +23,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: ["gc-compile-and-unit-test", "download_gc_plugins"]
diff --git a/pom.xml b/pom.xml
index 4ef35359c..7ee8e05ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -168,15 +168,6 @@
 		</dependency>	
 	</dependencies>
 
-	<modules>
-		<module>notification-core</module>
-		<module>provider/notification-gc</module>
-		<module>provider/notification-azure</module>
-		<module>provider/notification-ibm</module>
-		<module>provider/notification-aws</module>
-		<module>notification-core-plus</module>
-	</modules>
-
 	<repositories>
 		<repository>
 			<id>${repo.releases.id}</id>
@@ -195,25 +186,6 @@
 		</snapshotRepository>
 	</distributionManagement>
 
-	<profiles>
-		<profile>
-			<id>Default</id>
-			<activation>
-				<property>
-					<name>!repo.releases.id</name>
-				</property>
-			</activation>
-			<properties>
-				<repo.releases.id>community-maven-repo</repo.releases.id>
-				<publish.snapshots.id>community-maven-via-job-token</publish.snapshots.id>
-				<publish.releases.id>community-maven-via-job-token</publish.releases.id>
-				<repo.releases.url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</repo.releases.url>
-				<publish.snapshots.url>https://community.opengroup.org/api/v4/projects/143/packages/maven</publish.snapshots.url>
-				<publish.releases.url>https://community.opengroup.org/api/v4/projects/143/packages/maven</publish.releases.url>
-			</properties>
-		</profile>
-	</profiles>
-
 	<build>
 		<pluginManagement>
 			<plugins>
@@ -255,4 +227,42 @@
 			</plugin>
 		</plugins>
 	</build>
+
+	<profiles>
+		<profile>
+			<id>core</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<modules>
+				<module>notification-core</module>
+				<module>notification-core-plus</module>
+			</modules>
+		</profile>
+		<profile>
+			<id>aws</id>
+			<modules>
+				<module>provider/notification-aws</module>
+			</modules>
+		</profile>
+		<profile>
+			<id>azure</id>
+			<modules>
+				<module>provider/notification-azure</module>
+			</modules>
+		</profile>
+		<profile>
+			<id>ibm</id>
+			<modules>
+				<module>provider/notification-ibm</module>
+			</modules>
+		</profile>
+		<profile>
+			<id>gc</id>
+			<modules>
+				<module>provider/notification-gc</module>
+			</modules>
+		</profile>
+	</profiles>
+
 </project>
diff --git a/provider/notification-aws/build-aws/buildspec.yaml b/provider/notification-aws/build-aws/buildspec.yaml
index bdd553733..a96a38e8e 100644
--- a/provider/notification-aws/build-aws/buildspec.yaml
+++ b/provider/notification-aws/build-aws/buildspec.yaml
@@ -69,8 +69,8 @@ phases:
       - if [ "$GIT_SECRETS_SCAN_RESULT" = "FAILED" ]; then echo "Secrets detected!" && exit 1; fi
 
       - echo "Building primary service assemblies..."
-      - mvn --no-transfer-progress -ntp -B test install -pl .,notification-core,provider/notification-aws -Ddeployment.environment=prod  
-      - mvn --no-transfer-progress sonar:sonar -pl .,provider/notification-aws -Dsonar.scm.provider=git -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.host.url=${SONAR_URL}
+      - mvn --no-transfer-progress -ntp -B test install -pl .,notification-core,provider/notification-aws -P core, aws -Ddeployment.environment=prod
+      - mvn --no-transfer-progress sonar:sonar -pl .,provider/notification-aws -P aws -Dsonar.scm.provider=git -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/notification-test-aws/build-aws/prepare-dist.sh
-- 
GitLab