Skip to content
Snippets Groups Projects
Commit 73991e85 authored by Guillaume Caillet's avatar Guillaume Caillet
Browse files

Fix AWS integration test launch

parent 78fdeb75
No related branches found
No related tags found
2 merge requests!458Fix AWS integration test launch,!454AWS - Merge from dev
Pipeline #228758 failed
...@@ -157,7 +157,7 @@ azure_test: ...@@ -157,7 +157,7 @@ azure_test:
image: community.opengroup.org:5555/osdu/platform/deployment-and-operations/base-containers-azure/azure-maven17:v0.0.1 image: community.opengroup.org:5555/osdu/platform/deployment-and-operations/base-containers-azure/azure-maven17:v0.0.1
aws-test-java: 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: fossa-analyze:
......
...@@ -25,10 +25,13 @@ include: ...@@ -25,10 +25,13 @@ include:
aws-test-java: aws-test-java:
script: script:
- export KUBECONFIG=/tmp/kubeconfig-${RANDOM}.yaml - 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 - aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER_NAME --role-arn $EKS_CLUSTER_MGMT_ROLE
- chmod 600 $KUBECONFIG - 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 - $MAVEN_BUILD $INTEGRATION_TEST_DIR maven-aws-integration-test-output.log ${AWS_MAVEN_TEST_COMMAND_OVERRIDE:-test} --update-snapshots -DdisableXmlReport=true
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<dependency> <dependency>
<groupId>org.opengroup.osdu.core.aws</groupId> <groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId> <artifactId>os-core-lib-aws</artifactId>
<version>0.24.1-SNAPSHOT</version> <version>0.25.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
......
...@@ -36,7 +36,7 @@ limitations under the License. ...@@ -36,7 +36,7 @@ limitations under the License.
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <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> <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-java-sdk.version>1.11.1018</aws-java-sdk.version>
<aws-encryption-sdk-java.version>2.4.0</aws-encryption-sdk-java.version> <aws-encryption-sdk-java.version>2.4.0</aws-encryption-sdk-java.version>
......
...@@ -281,7 +281,7 @@ class CommonParameters: ...@@ -281,7 +281,7 @@ class CommonParameters:
self.kube_file = f"{self.push_namespace}.yaml" self.kube_file = f"{self.push_namespace}.yaml"
def _set_parameters(self): def _set_parameters(self):
sns_client = boto3.client('ssm') sns_client = boto3.client('ssm', region_name=self.region)
parameters = { parameters = {
f"/osdu/eks/{self.eks_cluster}/amp/workspace/id": "amp_workspace", 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", f"/osdu/eks/{self.eks_cluster}/instances/{self.osdu_instance}/ingress/osdu-gateway/name": "osdu_gateway",
...@@ -358,7 +358,11 @@ class CommonParameters: ...@@ -358,7 +358,11 @@ class CommonParameters:
if len(image_parts) != 2: if len(image_parts) != 2:
raise RuntimeError("Unexpected result from Kubectl command.") 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]}" endpoint_image = f"{image_parts[0]}:{endpoint_image_tag[:120]}"
env_file.write(f"export HMAC_SECRET={hmac_secret}\n") env_file.write(f"export HMAC_SECRET={hmac_secret}\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment