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:
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
- mkdir -p /root/.m2
......@@ -56,7 +56,7 @@ phases:
- printenv
- 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..."
- ./testing/register-test-aws/build-aws/prepare-dist.sh
......@@ -89,4 +89,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/**/*"
......@@ -64,7 +64,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.3.11</version>
<version>0.3.16</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
......@@ -148,4 +148,4 @@
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
</project>
......@@ -38,13 +38,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 "$INTEGRATION_TEST_SOURCE_DIR/pom.xml" "${OUTPUT_DIR}/testing"
\ No newline at end of file
cp "$INTEGRATION_TEST_SOURCE_DIR/pom.xml" "${OUTPUT_DIR}/testing"
......@@ -48,7 +48,7 @@ export REGISTER_CUSTOM_PUSH_URL1=$REGISTER_BASE_URL$REGISTER_CUSTOM_PUSH_PATH1
#### 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 #########################################################################
......@@ -59,4 +59,4 @@ if [ -n "$1" ]
cp -R "$SCRIPT_SOURCE_DIR"/../target/surefire-reports "$1"
fi
echo "### Register-Service Integration Tests Finished ###"
exit $TEST_EXIT_CODE
\ No newline at end of file
exit $TEST_EXIT_CODE
......@@ -130,7 +130,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.3.11</version>
<version>0.3.16</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
......
......@@ -23,7 +23,7 @@ import org.opengroup.osdu.core.aws.iam.IAMConfig;
import java.util.HashMap;
import java.util.Map;
//TODO: CognitoClient should use the client from core lib
public class AwsCognitoClient {
// Parameter value locations
......@@ -85,9 +85,14 @@ public class AwsCognitoClient {
public static AWSCognitoIdentityProvider generateCognitoClient()
{
return AWSCognitoIdentityProviderClientBuilder.standard()
.withCredentials(IAMConfig.amazonAWSCredentials())
.withRegion(AwsConfig.getAwsRegion())
.build();
AWSCognitoIdentityProviderClientBuilder builder = AWSCognitoIdentityProviderClientBuilder.standard()
.withCredentials(IAMConfig.amazonAWSCredentials());
String region = System.getenv("AWS_COGNITO_REGION");
if (region!=null){
builder.setRegion(region);
}else{
builder.withRegion(AwsConfig.getAwsRegion());
}
return builder.build();
}
}
Markdown is supported
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