codebuild/ci/release-ci.yml [20:36]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  pre_build:
    commands:
      - export SETTINGS_FILE=$(pwd)/codebuild/release/settings.xml
      - export CODEARTIFACT_TOKEN=$(aws codeartifact get-authorization-token --domain $DOMAIN --domain-owner $ACCOUNT --query authorizationToken --output text --region ${REGION})
      - export CODEARTIFACT_REPO_URL=https://${DOMAIN}-${ACCOUNT}.d.codeartifact.${REGION}.amazonaws.com/maven/${REPOSITORY}
      - aws secretsmanager get-secret-value --region us-west-2 --secret-id Maven-GPG-Keys --query SecretBinary --output text | base64 -d > ~/mvn_gpg.tgz
      - tar -xvf ~/mvn_gpg.tgz -C ~
  build:
    commands:
      - VERSION_HASH="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$CODEBUILD_RESOLVED_SOURCE_VERSION"
#      See https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
      - echo "Setting version in POM to $VERSION_HASH"
      - mvn versions:set -DnewVersion="$VERSION_HASH" --no-transfer-progress
      - echo "Version is now $(grep version pom.xml | head -n 1 | sed -n 's/[ \t]*<version>\(.*\)<\/version>/\1/p')"
      - |
        mvn deploy \
          -PpublishingCodeArtifact \
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



codebuild/release/release-staging.yml [21:37]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  pre_build:
    commands:
      - export SETTINGS_FILE=$(pwd)/codebuild/release/settings.xml
      - export CODEARTIFACT_TOKEN=$(aws codeartifact get-authorization-token --domain $DOMAIN --domain-owner $ACCOUNT --query authorizationToken --output text --region ${REGION})
      - export CODEARTIFACT_REPO_URL=https://${DOMAIN}-${ACCOUNT}.d.codeartifact.${REGION}.amazonaws.com/maven/${REPOSITORY}
      - aws secretsmanager get-secret-value --region us-west-2 --secret-id Maven-GPG-Keys --query SecretBinary --output text | base64 -d > ~/mvn_gpg.tgz
      - tar -xvf ~/mvn_gpg.tgz -C ~
  build:
    commands:
      - VERSION_HASH="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$CODEBUILD_RESOLVED_SOURCE_VERSION"
#      See https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
      - echo "Setting version in POM to $VERSION_HASH"
      - mvn versions:set -DnewVersion="$VERSION_HASH" --no-transfer-progress
      - echo "Version is now $(grep version pom.xml | head -n 1 | sed -n 's/[ \t]*<version>\(.*\)<\/version>/\1/p')"
      - |
        mvn deploy \
          -PpublishingCodeArtifact \
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



