From b98376f808a6410acd3d0e2411b7276859946491 Mon Sep 17 00:00:00 2001
From: Marc Burnie <mburnie@amazon.com>
Date: Tue, 6 Sep 2022 21:13:59 +0000
Subject: [PATCH] Versioning helm charts.

commit 89c186cf
Author: Marc Burnie <mburnie@amazon.com>
Date: Tue Aug 30 2022 09:23:35 GMT-0500 (Central Daylight Time)

    Merge branch 'dev' into helm


commit 0efec68a
Author: Marc Burnie <mburnie@amazon.com>
Date: Tue Aug 30 2022 07:39:08 GMT-0500 (Central Daylight Time)

    muting wget


commit e84dd1b2
Author: Marc Burnie <mburnie@amazon.com>
Date: Mon Aug 29 2022 13:51:51 GMT-0500 (Central Daylight Time)

    adding versioning helm chart


commit df1eb185
Author: Marc Burnie <mburnie@amazon.com>
Date: Fri Jul 29 2022 20:41:56 GMT-0500 (Central Daylight Time)

    changing role arn


commit ce3a8193
Author: Marc Burnie <mburnie@amazon.com>
Date: Fri Jul 29 2022 14:59:44 GMT-0500 (Central Daylight Time)

    Merge branch 'dev' into helm


commit 8330157c
Author: Marc Burnie <mburnie@amazon.com>
Date: Fri Jul 29 2022 14:55:34 GMT-0500 (Central Daylight Time)

    using release namespace


commit ae53b5ca
Author: Marc Burnie <mburnie@amazon.com>
Date: Wed Jul 27 2022 16:28:56 GMT-0500 (Central Daylight Time)

    using release namespace


commit b8f2d3a6
Author: Marc Burnie <mburnie@amazon.com>
Date: Wed Jul 27 2022 13:31:08 GMT-0500 (Central Daylight Time)

    using service name in template naming sheme due to shared namespacing


commit 27c61c24
Author: Marc Burnie <mburnie@amazon.com>
Date: Tue Jul 26 2022 16:28:04 GMT-0500 (Central Daylight Time)

    correcting hpa resource


commit 4f917414
Author: Marc Burnie <mburnie@amazon.com>
Date: Tue Jul 26 2022 10:42:21 GMT-0500 (Central Daylight Time)

    adding build files to helmignore


commit cf3f323e
Author: Marc Burnie <mburnie@amazon.com>
Date: Mon Jul 25 2022 16:53:34 GMT-0500 (Central Daylight Time)

    correcting README


commit aa7059e6
Author: Marc Burnie <mburnie@amazon.com>
Date: Mon Jul 25 2022 15:13:12 GMT-0500 (Central Daylight Time)

    fixing schema


commit eb1f361b
Author: Marc Burnie <mburnie@amazon.com>
Date: Mon Jul 25 2022 09:19:46 GMT-0500 (Central Daylight Time)

    updating values


commit f4610a97
Author: Marc Burnie <mburnie@amazon.com>
Date: Fri Jul 22 2022 12:43:19 GMT-0500 (Central Daylight Time)

    moving some parameters to global values


commit 488805fc
Author: Marc Burnie <mburnie@amazon.com>
Date: Wed Jul 20 2022 14:41:01 GMT-0500 (Central Daylight Time)

    adding initial service helm chart
---
 devops/aws/chart/Chart.yaml                        | 2 +-
 provider/notification-aws/build-aws/buildspec.yaml | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/devops/aws/chart/Chart.yaml b/devops/aws/chart/Chart.yaml
index 3360cafe4..943204a9e 100644
--- a/devops/aws/chart/Chart.yaml
+++ b/devops/aws/chart/Chart.yaml
@@ -1,6 +1,6 @@
 apiVersion: v2
 name: "os-notification"
-version: 0.1.0
+version:
 kubeVersion: "v1.21.x-x-x"
 description: Notification Helm Chart for Kubernetes
 type: application
diff --git a/provider/notification-aws/build-aws/buildspec.yaml b/provider/notification-aws/build-aws/buildspec.yaml
index 9ead110bd..875bb5dc8 100644
--- a/provider/notification-aws/build-aws/buildspec.yaml
+++ b/provider/notification-aws/build-aws/buildspec.yaml
@@ -41,6 +41,7 @@ phases:
       - mvn -version
       - mkdir -p /root/.m2
       - cp ./provider/notification-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,6 +71,7 @@ phases:
       - echo "Building integration testing assemblies and gathering artifacts..."
       - ./testing/notification-test-aws/build-aws/prepare-dist.sh
 
+      - 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}"
 
-- 
GitLab