diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3bc4d47c84f89f5d6d9149e7f6515a0c58d85998..0d301d39a7172eff7cfa3c20a354be0489731534 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -157,7 +157,7 @@ azure_test: image: community.opengroup.org:5555/osdu/platform/deployment-and-operations/base-containers-azure/azure-maven17:v0.0.1 aws-test-java: - image: $CI_REGISTRY/osdu/platform/deployment-and-operations/base-containers-aws/aws-maven/aws-maven:v2.0 + image: $CI_REGISTRY/osdu/platform/deployment-and-operations/base-containers-aws/aws-maven/aws-maven:v2.1 fossa-analyze: diff --git a/devops/aws/pipeline/override-stages.yml b/devops/aws/pipeline/override-stages.yml index 319799970d9aa1fe98ecd3b83baeb219857a6d16..bcdc513f7215810a1ea6971a20f7c36cfc8afb74 100644 --- a/devops/aws/pipeline/override-stages.yml +++ b/devops/aws/pipeline/override-stages.yml @@ -25,10 +25,13 @@ include: aws-test-java: script: - export KUBECONFIG=/tmp/kubeconfig-${RANDOM}.yaml - - echo "ROLE $EKS_CLUSTER_MGMT_ROLE" - - echo "CLUSTER $EKS_CLUSTER_NAME" - aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER_NAME --role-arn $EKS_CLUSTER_MGMT_ROLE - chmod 600 $KUBECONFIG - + - pip3 install boto3 + - export PUSH_ENDPOINT_PATH=testing/notification-test-aws/build-aws/push-endpoint + - echo "PUSH_ENDPOINT_PATH ${PUSH_ENDPOINT_PATH}" + - python3 $PUSH_ENDPOINT_PATH/setup_teardown_endpoint.py --create --environment_file $PUSH_ENDPOINT_PATH/environment_file.sh --kube_file $PUSH_ENDPOINT_PATH/push-endpoint-manifest.yaml + - trap "python3 $PUSH_ENDPOINT_PATH/setup_teardown_endpoint.py --delete --environment_file $PUSH_ENDPOINT_PATH/environment_file.sh --kube_file $PUSH_ENDPOINT_PATH/push-endpoint-manifest.yaml" EXIT + - source $PUSH_ENDPOINT_PATH/environment_file.sh - $MAVEN_BUILD $INTEGRATION_TEST_DIR maven-aws-integration-test-output.log ${AWS_MAVEN_TEST_COMMAND_OVERRIDE:-test} --update-snapshots -DdisableXmlReport=true diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml index 802095c0d370864ece9ba70ed2ff545109aa2b4b..bd5067fe44a7fc133ce9085ea198c95616015dd1 100644 --- a/provider/notification-aws/pom.xml +++ b/provider/notification-aws/pom.xml @@ -76,7 +76,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.24.1-SNAPSHOT</version> + <version>0.25.1-SNAPSHOT</version> </dependency> <dependency> <groupId>commons-io</groupId> diff --git a/testing/notification-test-aws/build-aws/push-endpoint/pom.xml b/testing/notification-test-aws/build-aws/push-endpoint/pom.xml index ea6830a6c855e4654571860c40e404de74296624..8b8855dad3f6823435b42ef23e157fcea8b7d43a 100644 --- a/testing/notification-test-aws/build-aws/push-endpoint/pom.xml +++ b/testing/notification-test-aws/build-aws/push-endpoint/pom.xml @@ -36,7 +36,7 @@ limitations under the License. <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <os-core-common.version>0.23.0-SNAPSHOT</os-core-common.version> + <os-core-common.version>0.25.0-rc2</os-core-common.version> <spring-boot-maven-plugin.version>2.7.6</spring-boot-maven-plugin.version> <aws-java-sdk.version>1.11.1018</aws-java-sdk.version> <aws-encryption-sdk-java.version>2.4.0</aws-encryption-sdk-java.version> diff --git a/testing/notification-test-aws/build-aws/push-endpoint/setup_teardown_endpoint.py b/testing/notification-test-aws/build-aws/push-endpoint/setup_teardown_endpoint.py index 959f85e3b8f6c23b2f7dae5bf469f9a8bc9d8455..922e9d2b328c909a2218e973456960b3058f8755 100644 --- a/testing/notification-test-aws/build-aws/push-endpoint/setup_teardown_endpoint.py +++ b/testing/notification-test-aws/build-aws/push-endpoint/setup_teardown_endpoint.py @@ -281,7 +281,7 @@ class CommonParameters: self.kube_file = f"{self.push_namespace}.yaml" def _set_parameters(self): - sns_client = boto3.client('ssm') + sns_client = boto3.client('ssm', region_name=self.region) parameters = { f"/osdu/eks/{self.eks_cluster}/amp/workspace/id": "amp_workspace", f"/osdu/eks/{self.eks_cluster}/instances/{self.osdu_instance}/ingress/osdu-gateway/name": "osdu_gateway", @@ -358,7 +358,11 @@ class CommonParameters: if len(image_parts) != 2: raise RuntimeError("Unexpected result from Kubectl command.") - endpoint_image_tag = f"push_endpoint.{image_parts[1].split('.', 1)[1]}" + # Depending on build env, images names could have two formats: + # - `build.dev.1101.COMMIT_HASH` on CodePipeline + # - `COMMIT_HASH` on Gitlab + # Using -1 as an index here after the split avoid an IndexError with the second case + endpoint_image_tag = f"push_endpoint.{image_parts[1].split('.', 1)[-1]}" endpoint_image = f"{image_parts[0]}:{endpoint_image_tag[:120]}" env_file.write(f"export HMAC_SECRET={hmac_secret}\n")