From d8384ae39cb8e1bb660f6fd749909fb1a6cb1b3b Mon Sep 17 00:00:00 2001 From: Ahmad Wilson Date: Fri, 2 Oct 2020 12:23:43 -0500 Subject: [PATCH 1/3] add || true to Chart.yaml find command since failures are expected and nonconsequential --- buildkite/scripts/helm-ci.sh | 76 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/buildkite/scripts/helm-ci.sh b/buildkite/scripts/helm-ci.sh index 53f19f1f762..b8e4ea325ed 100755 --- a/buildkite/scripts/helm-ci.sh +++ b/buildkite/scripts/helm-ci.sh @@ -2,63 +2,65 @@ set -eou pipefail -echo "--- Generating change DIFF" + diff=$( ./buildkite/scripts/generate-diff.sh ) +echo "--- Generated change DIFF: ${diff}" # Identifying modifications to helm charts (based on existence of Chart.yaml at change root) charts=$( for val in $diff; do - find $(dirname ${val:-""}) -name 'Chart.yaml'; + find $(dirname ${val}) -name 'Chart.yaml' || true; # failures occur when value is undefined due to empty diff done ) -# filter duplicates -charts=$(echo $charts | xargs -n1 | sort -u | xargs) -dirs=$(dirname $charts | xargs -n1 | sort -u | xargs) +if [ -n "$charts" ]; then + # filter duplicates + charts=$(echo $charts | xargs -n1 | sort -u | xargs) + dirs=$(dirname $charts | xargs -n1 | sort -u | xargs) -if [ -n "${HELM_LINT+x}" ]; then - for dir in $dirs; do - echo "--- Linting: ${dir}" - helm lint $dir + if [ -n "${HELM_LINT+x}" ]; then + for dir in $dirs; do + echo "--- Linting: ${dir}" + helm lint $dir - echo "--- Executing dry-run: ${dir}" - helm install test $dir --dry-run --namespace default - done -fi + echo "--- Executing dry-run: ${dir}" + helm install test $dir --dry-run --namespace default + done + fi -if [ -n "${HELM_RELEASE+x}" ]; then - syncDir="sync_dir" - stageDir="updates" - mkdir -p $stageDir $syncDir + if [ -n "${HELM_RELEASE+x}" ]; then + syncDir="sync_dir" + stageDir="updates" + mkdir -p $stageDir $syncDir - echo "--- Syncing with remote GCS Helm chart repository" - gsutil -m rsync ${CODA_CHART_REPO:-"gs://coda-charts/"} $syncDir + gsutil -m rsync ${CODA_CHART_REPO:-"gs://coda-charts/"} $syncDir - for dir in $dirs; do - echo "--- Preparing chart for Release: ${dir}" - helm package $dir --destination $stageDir + for dir in $dirs; do + echo "--- Preparing chart for Release: ${dir}" + helm package $dir --destination $stageDir - if [ -n "${HELM_EXPERIMENTAL_OCI+x}" ]; then - echo "--- Helm experimental OCI activated - deploying to GCR registry" - helm chart save $(basename $dir) + if [ -n "${HELM_EXPERIMENTAL_OCI+x}" ]; then + echo "--- Helm experimental OCI activated - deploying to GCR registry" + helm chart save $(basename $dir) - echo "--- Configuring Docker auth" - gcloud auth configure-docker - docker login "gcr.io/o1labs-192920/coda-charts/$(basename ${dir})" + gcloud auth configure-docker + docker login "gcr.io/o1labs-192920/coda-charts/$(basename ${dir})" - echo "--- Pushing chart" - helm chart push "gcr.io/o1labs-192920/coda-charts/$(basename ${dir})" - fi - done + helm chart push "gcr.io/o1labs-192920/coda-charts/$(basename ${dir})" + fi + done - cp --force --recursive "${stageDir}" "${syncDir}" + cp --force --recursive "${stageDir}" "${syncDir}" - helm repo index $syncDir + helm repo index $syncDir - if [ -n "${AUTO_DEPLOY+x}" ]; then - echo "--- Deploying/Syncing with remote repository" - gsutil -m rsync $syncDir ${CODA_CHART_REPO:-"gs://coda-charts/"} + if [ -n "${AUTO_DEPLOY+x}" ]; then + echo "--- Deploying/Syncing with remote repository" + gsutil -m rsync $syncDir ${CODA_CHART_REPO:-"gs://coda-charts/"} + fi fi +else + echo "No Helm chart changes found in DIFF." fi From 3aba651cbb692284004228ab0b2ba379ee4892d8 Mon Sep 17 00:00:00 2001 From: Ahmad Wilson Date: Fri, 2 Oct 2020 17:22:02 -0400 Subject: [PATCH 2/3] add helm change to test --- buildkite/helm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildkite/helm/README.md b/buildkite/helm/README.md index dcdf2b23cd4..2671649e978 100644 --- a/buildkite/helm/README.md +++ b/buildkite/helm/README.md @@ -1,6 +1,6 @@ ## Introduction -This chart bootstraps a Buildkite GraphQL API metrics exporter providing job and agent statistics to a Prometheus compatible endpoint. +This chart bootstraps a Buildkite GraphQL API metrics exporter providing job and agent statistics to a Prometheus compatible endpoint. TESTING ## Add Coda Helm chart repository: From 05509bbf453c410b777e4801a23b638d88b9c1bb Mon Sep 17 00:00:00 2001 From: Ahmad Wilson Date: Fri, 2 Oct 2020 17:33:36 -0400 Subject: [PATCH 3/3] remove helm chart change to end testing --- buildkite/helm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildkite/helm/README.md b/buildkite/helm/README.md index 2671649e978..dcdf2b23cd4 100644 --- a/buildkite/helm/README.md +++ b/buildkite/helm/README.md @@ -1,6 +1,6 @@ ## Introduction -This chart bootstraps a Buildkite GraphQL API metrics exporter providing job and agent statistics to a Prometheus compatible endpoint. TESTING +This chart bootstraps a Buildkite GraphQL API metrics exporter providing job and agent statistics to a Prometheus compatible endpoint. ## Add Coda Helm chart repository: