diff --git a/provider/legal-aws/build-aws/buildspec.yaml b/provider/legal-aws/build-aws/buildspec.yaml index 01ed13973390da3d5474bc1774ea8af5d7ec2117..99d9de73c83e76b2419c54626abe5c4d7d480428 100644 --- a/provider/legal-aws/build-aws/buildspec.yaml +++ b/provider/legal-aws/build-aws/buildspec.yaml @@ -28,8 +28,8 @@ phases: java: corretto8 commands: - if [ $(echo $CODEBUILD_SOURCE_VERSION | grep -c ^refs/heads.*) -eq 1 ]; then echo "Branch name found"; else echo "This build only supports branch builds" && exit 1; fi - - apt-get update -y - - apt-get install -y maven + - apt-get update -y -qq > /dev/null + - apt-get install -y maven -qq > /dev/null - java -version - mvn -version # - mvn -B clean # .m2 is not created until the first Maven command @@ -58,7 +58,7 @@ phases: - printenv - echo "Building primary service assemblies..." - - mvn -B test install -pl legal-core,provider/legal-aws -Ddeployment.environment=prod + - mvn -ntp -B test install -pl legal-core,provider/legal-aws -Ddeployment.environment=prod # Suspended until further notice # - echo "Copying assemblies to dist..." @@ -96,4 +96,4 @@ artifacts: name: ${REPO_NAME}_${BRANCH_NAME}_$(date +%F)_${CODEBUILD_BUILD_NUMBER}.zip cache: paths: - - "/root/.m2/**/*" \ No newline at end of file + - "/root/.m2/**/*" diff --git a/provider/legal-aws/pom.xml b/provider/legal-aws/pom.xml index 4a2b6c8e9636217c992cfc0c1284d8e70a331667..b507389418e0b8e43d800d41626e9f7c1a5226b4 100644 --- a/provider/legal-aws/pom.xml +++ b/provider/legal-aws/pom.xml @@ -37,7 +37,7 @@ <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> <artifactId>os-core-lib-aws</artifactId> - <version>0.3.7</version> + <version>0.3.16</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> diff --git a/testing/legal-test-aws/build-aws/prepare-dist.sh b/testing/legal-test-aws/build-aws/prepare-dist.sh index 399037b4cf273a594f7ce8b3ac28de4e286ee28d..baa16e0c8f465655d25f1dfd39bd6789ce553f85 100755 --- a/testing/legal-test-aws/build-aws/prepare-dist.sh +++ b/testing/legal-test-aws/build-aws/prepare-dist.sh @@ -21,13 +21,13 @@ echo $INTEGRATION_TEST_OUTPUT_BIN_DIR rm -rf "$INTEGRATION_TEST_OUTPUT_DIR" mkdir -p "$INTEGRATION_TEST_OUTPUT_DIR" && mkdir -p "$INTEGRATION_TEST_OUTPUT_BIN_DIR" echo "Building integration testing assemblies and gathering artifacts..." -mvn install -f "$INTEGRATION_TEST_SOURCE_DIR_CORE"/pom.xml -mvn install dependency:copy-dependencies -DskipTests -f "$INTEGRATION_TEST_SOURCE_DIR_AWS"/pom.xml -DincludeGroupIds=org.opengroup.osdu -Dmdep.copyPom +mvn -ntp install -f "$INTEGRATION_TEST_SOURCE_DIR_CORE"/pom.xml +mvn -ntp install dependency:copy-dependencies -DskipTests -f "$INTEGRATION_TEST_SOURCE_DIR_AWS"/pom.xml -DincludeGroupIds=org.opengroup.osdu -Dmdep.copyPom cp "$INTEGRATION_TEST_SOURCE_DIR_AWS"/target/dependency/* "${INTEGRATION_TEST_OUTPUT_BIN_DIR}" -(cd "${INTEGRATION_TEST_OUTPUT_BIN_DIR}" && ls *.jar | sed -e 's/\.jar$//' | xargs -I {} echo mvn install:install-file -Dfile={}.jar -DpomFile={}.pom >> install-deps.sh) +(cd "${INTEGRATION_TEST_OUTPUT_BIN_DIR}" && ls *.jar | sed -e 's/\.jar$//' | xargs -I {} echo mvn -ntp install:install-file -Dfile={}.jar -DpomFile={}.pom >> install-deps.sh) chmod +x "${INTEGRATION_TEST_OUTPUT_BIN_DIR}"/install-deps.sh -mvn clean -f "$INTEGRATION_TEST_SOURCE_DIR_AWS"/pom.xml +mvn -ntp clean -f "$INTEGRATION_TEST_SOURCE_DIR_AWS"/pom.xml cp -R "$INTEGRATION_TEST_SOURCE_DIR_AWS"/* "${INTEGRATION_TEST_OUTPUT_DIR}"/ #copy testing parent pom to output -cp ./testing/pom.xml "${OUTPUT_DIR}/testing" \ No newline at end of file +cp ./testing/pom.xml "${OUTPUT_DIR}/testing" diff --git a/testing/legal-test-aws/build-aws/run-tests.sh b/testing/legal-test-aws/build-aws/run-tests.sh index d5c64f7d2e39297671f79f0fb1f5cf6eae68e85d..1a32cd848b400effb539715343abf509a670888c 100755 --- a/testing/legal-test-aws/build-aws/run-tests.sh +++ b/testing/legal-test-aws/build-aws/run-tests.sh @@ -29,10 +29,22 @@ export AWS_COGNITO_AUTH_FLOW=USER_PASSWORD_AUTH export AWS_COGNITO_AUTH_PARAMS_PASSWORD=$ADMIN_PASSWORD export AWS_COGNITO_AUTH_PARAMS_USER=$ADMIN_USER export AWS_COGNITO_CLIENT_ID=$AWS_COGNITO_CLIENT_ID -export AWS_S3_ENDPOINT=s3.us-east-1.amazonaws.com -export AWS_S3_REGION=us-east-1 -export DYNAMO_DB_ENDPOINT=dynamodb.us-east-1.amazonaws.com -export DYNAMO_DB_REGION=us-east-1 +if [ -z "$LEGAL_S3_ENDPOINT" ] +then + export AWS_S3_ENDPOINT=s3.us-east-1.amazonaws.com +else + export AWS_S3_ENDPOINT=$LEGAL_S3_ENDPOINT +fi + +export AWS_S3_REGION=$AWS_REGION +if [ -z "$LEGAL_DYNAMODB_ENDPOINT" ] +then + export DYNAMO_DB_ENDPOINT=dynamodb.us-east-1.amazonaws.com +else + export DYNAMO_DB_ENDPOINT=$LEGAL_DYNAMODB_ENDPOINT + +fi +export DYNAMO_DB_REGION=$AWS_REGION export HOST_URL=$LEGAL_URL export MY_TENANT=int-test-legal export S3_LEGAL_CONFIG_BUCKET=$LEGAL_S3_BUCKET @@ -42,7 +54,7 @@ export TABLE_PREFIX=$RESOURCE_PREFIX #### RUN INTEGRATION TEST ######################################################################### -mvn test -f "$SCRIPT_SOURCE_DIR"/../pom.xml +mvn -ntp test -f "$SCRIPT_SOURCE_DIR"/../pom.xml TEST_EXIT_CODE=$? #### COPY TEST REPORTS ######################################################################### @@ -53,4 +65,4 @@ if [ -n "$1" ] cp -R "$SCRIPT_SOURCE_DIR"/../target/surefire-reports "$1" fi -exit $TEST_EXIT_CODE \ No newline at end of file +exit $TEST_EXIT_CODE diff --git a/testing/legal-test-aws/src/test/java/org/opengroup/osdu/legal/util/AwsLegalTagUtils.java b/testing/legal-test-aws/src/test/java/org/opengroup/osdu/legal/util/AwsLegalTagUtils.java index 4b0de1bdb8f493f5d7896c25e0edf6236750f99c..329990130bcc766195d136c860373afb077578b0 100644 --- a/testing/legal-test-aws/src/test/java/org/opengroup/osdu/legal/util/AwsLegalTagUtils.java +++ b/testing/legal-test-aws/src/test/java/org/opengroup/osdu/legal/util/AwsLegalTagUtils.java @@ -48,6 +48,7 @@ public class AwsLegalTagUtils extends LegalTagUtils { S3Config s3Config = new S3Config(amazonS3Endpoint, amazonS3Region); AmazonS3 s3Client = s3Config.amazonS3(); + try { s3Client.putObject(BUCKET_NAME_AWS, FILE_NAME, readTestFile("TenantConfigTestingPurpose.json")); } catch(IOException e){