diff --git a/devops/aws/chart/Chart.yaml b/devops/aws/chart/Chart.yaml index 92d0a190d6ba71894e31ca6ba224bcc8f1ad1c0f..b96b823b85b17cba8d8085e29a0edbce7d40c560 100644 --- a/devops/aws/chart/Chart.yaml +++ b/devops/aws/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: os-partition -version: 0.1.0 +version: kubeVersion: "v1.21.x-x-x" description: Partitions Helm chart for Kubernetes type: application diff --git a/provider/partition-aws/build-aws/buildspec.yaml b/provider/partition-aws/build-aws/buildspec.yaml index ea8d6a608ac59270d947aa87118eca39177037a3..ba28b3c856db0a0356bcdaab65be37a863d3aff4 100644 --- a/provider/partition-aws/build-aws/buildspec.yaml +++ b/provider/partition-aws/build-aws/buildspec.yaml @@ -41,6 +41,7 @@ phases: - mvn -version - mkdir -p /root/.m2 - cp ./provider/partition-aws/maven/settings.xml /root/.m2/settings.xml # copy the AWS-specific settings.xml to the CodeBuild instance's .m2 folder + - wget https://github.com/mikefarah/yq/releases/download/v4.27.2/yq_linux_amd64 -q -O /usr/bin/yq && chmod +x /usr/bin/yq - 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: @@ -60,6 +61,8 @@ phases: - 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 + - pom_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + - export VERSION=${pom_version%-*} - printenv - echo "Building primary service assemblies..." @@ -68,15 +71,10 @@ phases: - echo "Building integration testing assemblies and gathering artifacts..." - ./testing/partition-test-aws/build-aws/prepare-dist.sh - # Push Helm charts to repo - # - cd devops/charts - # - for dir in */ ; do chart=$(echo ${dir} | sed 's:/*$::'); helm s3 init ${HELM_REPO}/${BRANCH_NAME}/${chart}; helm repo add --force-update ${chart} ${HELM_REPO}/${BRANCH_NAME}/${chart}; helm package ./${chart}; helm s3 push --force $(find . -name ${chart}'-*.tgz' -print | head -n 1) ${chart}; done - # - cd ../.. - + - yq -i '.version = strenv(VERSION)' devops/aws/chart/Chart.yaml - echo "--Copying Helm Charts to ${OUTPUT_DIR:-dist}--" - rsync -r devops/aws/* "${OUTPUT_DIR:-dist}" - - echo "Logging into Docker Hub..." - docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}