Skip to content

Commit

Permalink
chore: update release process (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
imabhichow authored Dec 6, 2023
1 parent 9297e1b commit f222462
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cfn/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Resources:
## If this value is 0, greater than 25, or not provided then the full history is downloaded with each build project.
GitCloneDepth: 0
GitSubmodulesConfig:
FetchSubmodules: false
FetchSubmodules: true
InsecureSsl: false
ReportBuildStatus: false
Type: GITHUB
Expand Down
10 changes: 8 additions & 2 deletions codebuild/ci/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,21 @@ phases:
--package $PACKAGE \
--versions $VERSION_HASH \
--region $REGION;
# Assume Role to access non-prod resources
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Java-Role-us-west-2" --role-session-name "CB-TestVectorResources")
- export TMP_ROLE
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
- aws sts get-caller-identity
# 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 \
-Dmaven.test.skip=true \
-Pfast-tests-only \
-DperformRelease \
-Dgpg.homedir="$HOME/mvn_gpg" \
-DautoReleaseAfterClose=true \
Expand Down
7 changes: 7 additions & 0 deletions codebuild/release/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ phases:
- cd $CODEBUILD_SRC_DIR
build:
commands:
# Assume Role to access non-prod resources
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Java-Role-us-west-2" --role-session-name "CB-TestVectorResources")
- export TMP_ROLE
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
- aws sts get-caller-identity
- |
mvn deploy \
-Ppublishing \
Expand Down
8 changes: 8 additions & 0 deletions codebuild/release/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ phases:
- cd $CODEBUILD_SRC_DIR
build:
commands:
# Assume Role to access non-prod resources
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Java-Role-us-west-2" --role-session-name "CB-TestVectorResources")
- export TMP_ROLE
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
- aws sts get-caller-identity

- 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"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.88</minimum>
<minimum>0.87</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
Expand Down

0 comments on commit f222462

Please sign in to comment.