Skip to content
Snippets Groups Projects
  • Spencer Sutton's avatar
    800706a3
    RequestScope fix for AWS legal repo factory · 800706a3
    Spencer Sutton authored
    commit 1c6097e5 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 14:46:06 GMT-0500 (Central Daylight Time) 
    
        Merge branch 'dev' of codecommit::us-east-1://default@os-legal into compliance-trigger
    
    
    commit 8e1b36f7 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 14:45:31 GMT-0500 (Central Daylight Time) 
    
        Fixing int tests
    
    
    commit 88c9315c 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 13:46:33 GMT-0500 (Central Daylight Time) 
    
        Disabling sonar
    
    
    commit 8a69da05 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 13:45:51 GMT-0500 (Central Daylight Time) 
    
        Testing int test failure
    
    
    commit bb5e4245 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Thu Oct 14 2021 15:13:38 GMT-0500 (Central Daylight Time) 
    
        Merge branch 'dev' of codecommit::us-east-1://default@os-legal into compliance-trigger
    
    
    commit d8d0fd56 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Thu Oct 14 2021 15:12:47 GMT-0500 (Central Daylight Time) 
    
        Fixing broken unit test
    
    
    commit 36b1e2f7 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Thu Oct 14 2021 10:54:20 GMT-0500 (Central Daylight Time) 
    
        Adding log warning
    
    
    commit 3a0c1745 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Wed Oct 13 2021 14:34:37 GMT-0500 (Central Daylight Time) 
    
        Fixing problem where data partitions got stuck across calls
    
    
    commit 9dbff512 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Wed Oct 13 2021 12:51:01 GMT-0500 (Central Daylight Time) 
    
        Fixing bug with compliance process, partitions weren't handled right
    
    
    commit b663408a 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 08 2021 15:11:59 GMT-0500 (Central Daylight Time) 
    
        Adding custom class to include data partition
    800706a3
    History
    RequestScope fix for AWS legal repo factory
    Spencer Sutton authored
    commit 1c6097e5 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 14:46:06 GMT-0500 (Central Daylight Time) 
    
        Merge branch 'dev' of codecommit::us-east-1://default@os-legal into compliance-trigger
    
    
    commit 8e1b36f7 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 14:45:31 GMT-0500 (Central Daylight Time) 
    
        Fixing int tests
    
    
    commit 88c9315c 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 13:46:33 GMT-0500 (Central Daylight Time) 
    
        Disabling sonar
    
    
    commit 8a69da05 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 15 2021 13:45:51 GMT-0500 (Central Daylight Time) 
    
        Testing int test failure
    
    
    commit bb5e4245 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Thu Oct 14 2021 15:13:38 GMT-0500 (Central Daylight Time) 
    
        Merge branch 'dev' of codecommit::us-east-1://default@os-legal into compliance-trigger
    
    
    commit d8d0fd56 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Thu Oct 14 2021 15:12:47 GMT-0500 (Central Daylight Time) 
    
        Fixing broken unit test
    
    
    commit 36b1e2f7 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Thu Oct 14 2021 10:54:20 GMT-0500 (Central Daylight Time) 
    
        Adding log warning
    
    
    commit 3a0c1745 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Wed Oct 13 2021 14:34:37 GMT-0500 (Central Daylight Time) 
    
        Fixing problem where data partitions got stuck across calls
    
    
    commit 9dbff512 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Wed Oct 13 2021 12:51:01 GMT-0500 (Central Daylight Time) 
    
        Fixing bug with compliance process, partitions weren't handled right
    
    
    commit b663408a 
    Author: Spencer Sutton <suttonsp@amazon.com> 
    Date: Fri Oct 08 2021 15:11:59 GMT-0500 (Central Daylight Time) 
    
        Adding custom class to include data partition
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
buildspec.yaml 5.29 KiB
# Copyright © 2020 Amazon Web Services
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html

# https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
version: 0.2

env:
  secrets-manager:
    DOCKER_USERNAME: /osdu/devops/docker_credentials:username
    DOCKER_PASSWORD: /osdu/devops/docker_credentials:password
    SONAR_USERNAME: /osdu/devops/sonar_credentials:username
    SONAR_PASSWORD: /osdu/devops/sonar_credentials:password
  
  parameter-store:
    SONAR_URL: /osdu/devops/sonar_url

phases:
  install:
    runtime-versions:
      java: corretto8
    commands:
      # fix error noted here: https://github.com/yarnpkg/yarn/issues/7866
      - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
      - 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 -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
      - echo $JAVA_HOME #WHY
      - mkdir -p /root/.m2
      - cp ./provider/legal-aws/maven/settings.xml /root/.m2/settings.xml # copy the AWS-specific settings.xml to the CodeBuild instance's .m2 folder
      - export AWS_ACCOUNT_ID=`aws sts get-caller-identity | grep Account | cut -d':' -f 2 | cut -d'"' -f 2`
      - export AWS_OSDU_DEV_MAVEN_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain $AWS_OSDU_DEV_MAVEN_DOMAIN --domain-owner $AWS_ACCOUNT_ID --query authorizationToken --output text`
  pre_build:
    commands:
      - echo "Logging in to Amazon ECR..."
      - $(aws ecr get-login --no-include-email --region $AWS_REGION) # authenticate with ECR via the AWS CLI
  build:
    commands:
      - export REPO_NAME=${PWD##*/}
      - export OUTPUT_DIR="dist"
      - export BRANCH_NAME=`echo ${CODEBUILD_SOURCE_VERSION} | awk '{gsub("refs/heads/","");gsub("\\.","-");gsub("[[:space:]]","-")}1' | sed 's/\//-/g' | awk '{print tolower($0)}'`
      - export ECR_TAG=`echo build.${BRANCH_NAME}.${CODEBUILD_BUILD_NUMBER}.${CODEBUILD_RESOLVED_SOURCE_VERSION} | cut -c 1-120`
      - export ECR_IMAGE=${ECR_REGISTRY}:${ECR_TAG}
      - export ECR_IMAGE_BRANCH_LATEST=${ECR_REGISTRY}:${BRANCH_NAME}
      - export INTEGRATION_TEST_OUTPUT=${OUTPUT_DIR}/testing/integration
      - export INTEGRATION_TEST_OUTPUT_BIN=${INTEGRATION_TEST_OUTPUT}/bin
      - mkdir -p ${OUTPUT_DIR}/bin
      - mkdir -p ${OUTPUT_DIR}/testing && mkdir -p ${INTEGRATION_TEST_OUTPUT}  && mkdir -p ${INTEGRATION_TEST_OUTPUT}/bin
      - echo "Placeholder" >> ${OUTPUT_DIR}/build-info.json # touched so that the output directory has some content incase the build fails so that testing reports are uploaded
      - printenv

      - echo "Building primary service assemblies..."
      - mvn -ntp -B test install sonar:sonar -pl .,legal-core,provider/legal-aws -Ddeployment.environment=prod -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME}

      #      Suspended until further notice