version: 0.2

phases:
  install:
    runtime-versions:
      java: "$JAVA_RUNTIME"

  build:
    commands:
      - |
        if [ ! -z "$INTEGRATION_TEST_ROLE_ARN" ]; then
          ASSUME_ROLE_OUTPUT=`aws sts assume-role --role-arn "$INTEGRATION_TEST_ROLE_ARN" --role-session-name "integration-tests" --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text`
          AWS_ACCESS_KEY_ID=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $1 }'`
          AWS_SECRET_ACCESS_KEY=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $2 }'`
          AWS_SESSION_TOKEN=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $3 }'`
          echo "Using role $INTEGRATION_TEST_ROLE_ARN with access key $AWS_ACCESS_KEY_ID."
        fi
      - mvn clean install -Dskip.unit.tests -P integration-tests -Dfindbugs.skip -Dcheckstyle.skip -T1C
      - JAVA_VERSION=$(java -version 2>&1 | grep -i version | cut -d'"' -f2 | cut -d'.' -f1-1)
      - echo $JAVA_VERSION
      - |
        if [ "$JAVA_VERSION" -ge "9" ]; then
          cd test/module-path-tests
          mvn package
          mvn exec:exec -P integ-tests
        fi
version: 0.2

phases:
  install:
    runtime-versions:
      java: "$JAVA_RUNTIME"

  build:
    commands:
      - |
        if [ ! -z "$INTEGRATION_TEST_ROLE_ARN" ]; then
          ASSUME_ROLE_OUTPUT=`aws sts assume-role --role-arn "$INTEGRATION_TEST_ROLE_ARN" --role-session-name "integration-tests" --duration-seconds 7200 --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text`
          AWS_ACCESS_KEY_ID=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $1 }'`
          AWS_SECRET_ACCESS_KEY=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $2 }'`
          AWS_SESSION_TOKEN=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $3 }'`
          echo "Using role $INTEGRATION_TEST_ROLE_ARN with access key $AWS_ACCESS_KEY_ID."
        fi
      - mvn clean install -Dskip.unit.tests -P integration-tests -Dfindbugs.skip -Dcheckstyle.skip -T1C
      - JAVA_VERSION=$(java -version 2>&1 | grep -i version | cut -d'"' -f2 | cut -d'.' -f1-1)
      - echo $JAVA_VERSION
      - |
        if [ "$JAVA_VERSION" -ge "9" ]; then
          cd test/module-path-tests
          mvn package
          mvn exec:exec -P integ-tests
        fi
Update the assumed role in integration tests to last 2 hours, instead of the default time.
Update the assumed role in integration tests to last 2 hours, instead of the default time.
