From 9f1e0a74430066c628a9b58b73d392e21525e72e Mon Sep 17 00:00:00 2001 From: ranchodeluxe Date: Mon, 3 Jul 2023 12:31:53 -0700 Subject: [PATCH] default gitSha and insert main gitSha for distributed helm-chart --- .github/workflows/helm-tests.yml | 4 ++-- .github/workflows/release.yml | 4 ++++ README.md | 1 - helm-chart/eoapi/values.yaml | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index 0d17af1a..acb0ec26 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -122,8 +122,8 @@ jobs: - name: run the tests run: | - # first substitute test enpoints in the test files - # TODO: pytest should be able to have a pattern for injection here but htis is quicker + # first substitute test endpoints in the test files + # TODO: pytest should be able to have a pattern for injection here but moving fast URL=$(minikube service vector --url) sed -i "s|vector_endpoint\=.*$|vector_endpoint\='$URL'|g" .github/workflows/tests/test_vector.py head -n 5 .github/workflows/tests/test_vector.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66914cca..48acf484 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,10 @@ jobs: # create the index file helm repo index . + # update `values.yaml` with a gitSha + COMMITSHA=$(git rev-parse HEAD | cut -c1-10) + sed -i "s|gitSha: \"\"|gitSha: \"$COMMITSHA\"|g" "$helm-chart"/values.yaml + git add -A chart_version=$(cat $chart/Chart.yaml| grep version: | cut -d' ' -f2) git commit -m $chart_version diff --git a/README.md b/README.md index f10549bf..c04353ae 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,6 @@ Once you have a k8s cluster set up you can `helm install` eoAPI as follows # add the required secret overrides to an arbitrarily named `.yaml` file (`config.yaml` below) $ cat config.yaml - gitSha: "AB123" db: settings: secrets: diff --git a/helm-chart/eoapi/values.yaml b/helm-chart/eoapi/values.yaml index 4ed0f6e3..00b3e9d8 100644 --- a/helm-chart/eoapi/values.yaml +++ b/helm-chart/eoapi/values.yaml @@ -64,7 +64,9 @@ db: # "gcp" will be an option available in the future providerContext: "aws" -gitSha: "" +# if running `helm install` from repo directory you'll have to provide this +# otherwise the chart on the gh-pages branch will provide the correct updated value +gitSha: "gitshaABC123" service: port: 8080