From 9d2d12d248d0dddb3ee713a17bfdc7594ab0283d Mon Sep 17 00:00:00 2001
From: Marc Burnie <mburnie@amazon.com>
Date: Tue, 20 Sep 2022 15:41:29 +0000
Subject: [PATCH] Verisoning helm chart

---
 devops/aws/chart/Chart.yaml                     | 2 +-
 devops/aws/chart/values.yaml                    | 2 +-
 provider/partition-aws/build-aws/buildspec.yaml | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/devops/aws/chart/Chart.yaml b/devops/aws/chart/Chart.yaml
index b96b823b8..69b2038d4 100644
--- a/devops/aws/chart/Chart.yaml
+++ b/devops/aws/chart/Chart.yaml
@@ -1,6 +1,6 @@
 apiVersion: v2
 name: os-partition
-version:
+version: __CHART_VERSION__
 kubeVersion: "v1.21.x-x-x"
 description: Partitions Helm chart for Kubernetes
 type: application
diff --git a/devops/aws/chart/values.yaml b/devops/aws/chart/values.yaml
index 5b01cf0f2..0fdde033b 100644
--- a/devops/aws/chart/values.yaml
+++ b/devops/aws/chart/values.yaml
@@ -77,7 +77,7 @@ autoscaling:
   targetCPUUtilizationPercentage: 80
   # targetMemoryUtilizationPercentage: 80
 # Security Config
-serviceAccountRole: arn:aws:iam::{{ .Values.global.accountID }}:role/osdu-{{ .Values.global.resourcePrefix }}-{{ include "common.name" . }}
+serviceAccountRole: arn:aws:iam::{{ .Values.global.accountID }}:role/osdu-{{ .Values.global.resourcePrefix }}-{{ .Values.global.region }}-{{ include "common.name" . }}
 cors:
   maxAge: "60m"
   allowCredentials: true
diff --git a/provider/partition-aws/build-aws/buildspec.yaml b/provider/partition-aws/build-aws/buildspec.yaml
index 9730df792..aff825682 100644
--- a/provider/partition-aws/build-aws/buildspec.yaml
+++ b/provider/partition-aws/build-aws/buildspec.yaml
@@ -41,7 +41,6 @@ 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`
       # Install git secrets
@@ -78,7 +77,8 @@ phases:
       - echo "Building integration testing assemblies and gathering artifacts..."
       - ./testing/partition-test-aws/build-aws/prepare-dist.sh
 
-      - yq -i '.version = strenv(VERSION)' devops/aws/chart/Chart.yaml
+      - sed -i "s|__CHART_VERSION__|$VERSION|"  devops/aws/chart/Chart.yaml
+      - sed -i "s|__CONTAINER__|$ECR_IMAGE|"  devops/aws/chart/values.yaml
       - echo "--Copying Helm Charts to ${OUTPUT_DIR:-dist}--"
       - rsync -r devops/aws/* "${OUTPUT_DIR:-dist}"
 
-- 
GitLab