Commit 1478600b authored by Bill Wang's avatar Bill Wang Committed by Sutton
Browse files

Squashed commit of the following

commit 93d433a6 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 13:30:27 GMT-0800 (Pacific Standard Time) 

    fix Cognito client


commit 56a2c109 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 12:15:56 GMT-0800 (Pacific Standard Time) 

    bump core lib version


commit 5a6fc50d 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 09:57:31 GMT-0800 (Pacific Standard Time) 

    fix os core lib version


commit 90406044 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 09:56:12 GMT-0800 (Pacific Standard Time) 

    supress maven log
parent 8823f3f5
...@@ -28,8 +28,8 @@ phases: ...@@ -28,8 +28,8 @@ phases:
java: corretto8 java: corretto8
commands: 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 - 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 update -y -qq >/dev/null
- apt-get install -y maven - apt-get install -y maven -qq >/dev/null
- java -version - java -version
- mvn -version - mvn -version
- mkdir -p /root/.m2 - mkdir -p /root/.m2
...@@ -56,7 +56,7 @@ phases: ...@@ -56,7 +56,7 @@ phases:
- printenv - printenv
- echo "Building primary service assemblies..." - echo "Building primary service assemblies..."
- mvn -B test install -pl register-core,provider/register-aws -Ddeployment.environment=prod - mvn -ntp -B test install -pl register-core,provider/register-aws -Ddeployment.environment=prod
- echo "Building integration testing assemblies and gathering artifacts..." - echo "Building integration testing assemblies and gathering artifacts..."
- ./testing/register-test-aws/build-aws/prepare-dist.sh - ./testing/register-test-aws/build-aws/prepare-dist.sh
...@@ -89,4 +89,4 @@ artifacts: ...@@ -89,4 +89,4 @@ artifacts:
name: ${REPO_NAME}_${BRANCH_NAME}_$(date +%F)_${CODEBUILD_BUILD_NUMBER}.zip name: ${REPO_NAME}_${BRANCH_NAME}_$(date +%F)_${CODEBUILD_BUILD_NUMBER}.zip
cache: cache:
paths: paths:
- "/root/.m2/**/*" - "/root/.m2/**/*"
\ No newline at end of file
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,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.3.11</version> <version>0.3.16</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.opengroup.osdu</groupId> <groupId>org.opengroup.osdu</groupId>
...@@ -148,4 +148,4 @@ ...@@ -148,4 +148,4 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
\ No newline at end of file
...@@ -38,13 +38,13 @@ echo $INTEGRATION_TEST_OUTPUT_BIN_DIR ...@@ -38,13 +38,13 @@ echo $INTEGRATION_TEST_OUTPUT_BIN_DIR
rm -rf "$INTEGRATION_TEST_OUTPUT_DIR" rm -rf "$INTEGRATION_TEST_OUTPUT_DIR"
mkdir -p "$INTEGRATION_TEST_OUTPUT_DIR" && mkdir -p "$INTEGRATION_TEST_OUTPUT_BIN_DIR" mkdir -p "$INTEGRATION_TEST_OUTPUT_DIR" && mkdir -p "$INTEGRATION_TEST_OUTPUT_BIN_DIR"
echo "Building integration testing assemblies and gathering artifacts..." echo "Building integration testing assemblies and gathering artifacts..."
mvn install -f "$INTEGRATION_TEST_SOURCE_DIR_CORE"/pom.xml mvn -ntp 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 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}" 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 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}"/ cp -R "$INTEGRATION_TEST_SOURCE_DIR_AWS"/* "${INTEGRATION_TEST_OUTPUT_DIR}"/
#copy testing parent pom to output #copy testing parent pom to output
cp "$INTEGRATION_TEST_SOURCE_DIR/pom.xml" "${OUTPUT_DIR}/testing" cp "$INTEGRATION_TEST_SOURCE_DIR/pom.xml" "${OUTPUT_DIR}/testing"
\ No newline at end of file
...@@ -48,7 +48,7 @@ export REGISTER_CUSTOM_PUSH_URL1=$REGISTER_BASE_URL$REGISTER_CUSTOM_PUSH_PATH1 ...@@ -48,7 +48,7 @@ export REGISTER_CUSTOM_PUSH_URL1=$REGISTER_BASE_URL$REGISTER_CUSTOM_PUSH_PATH1
#### RUN INTEGRATION TEST ######################################################################### #### RUN INTEGRATION TEST #########################################################################
mvn test -f "$SCRIPT_SOURCE_DIR"/../pom.xml mvn -ntp test -f "$SCRIPT_SOURCE_DIR"/../pom.xml
TEST_EXIT_CODE=$? TEST_EXIT_CODE=$?
#### COPY TEST REPORTS ######################################################################### #### COPY TEST REPORTS #########################################################################
...@@ -59,4 +59,4 @@ if [ -n "$1" ] ...@@ -59,4 +59,4 @@ if [ -n "$1" ]
cp -R "$SCRIPT_SOURCE_DIR"/../target/surefire-reports "$1" cp -R "$SCRIPT_SOURCE_DIR"/../target/surefire-reports "$1"
fi fi
echo "### Register-Service Integration Tests Finished ###" echo "### Register-Service Integration Tests Finished ###"
exit $TEST_EXIT_CODE exit $TEST_EXIT_CODE
\ No newline at end of file
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,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.3.11</version> <version>0.3.16</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.amazonaws</groupId> <groupId>com.amazonaws</groupId>
......
...@@ -23,7 +23,7 @@ import org.opengroup.osdu.core.aws.iam.IAMConfig; ...@@ -23,7 +23,7 @@ import org.opengroup.osdu.core.aws.iam.IAMConfig;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
//TODO: CognitoClient should use the client from core lib
public class AwsCognitoClient { public class AwsCognitoClient {
// Parameter value locations // Parameter value locations
...@@ -85,9 +85,14 @@ public class AwsCognitoClient { ...@@ -85,9 +85,14 @@ public class AwsCognitoClient {
public static AWSCognitoIdentityProvider generateCognitoClient() public static AWSCognitoIdentityProvider generateCognitoClient()
{ {
return AWSCognitoIdentityProviderClientBuilder.standard() AWSCognitoIdentityProviderClientBuilder builder = AWSCognitoIdentityProviderClientBuilder.standard()
.withCredentials(IAMConfig.amazonAWSCredentials()) .withCredentials(IAMConfig.amazonAWSCredentials());
.withRegion(AwsConfig.getAwsRegion()) String region = System.getenv("AWS_COGNITO_REGION");
.build(); if (region!=null){
builder.setRegion(region);
}else{
builder.withRegion(AwsConfig.getAwsRegion());
}
return builder.build();
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment