Skip to content

Commit

Permalink
Ensure that appVersion always matches .image.tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvind Iyengar committed Jan 30, 2023
1 parent edc2b6b commit 257d57e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.40.1; \
fi

ENV YQ_VERSION=v4.25.1
RUN wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${ARCH} -O /usr/bin/yq && chmod +x /usr/bin/yq;

COPY --from=helm ./helm/bin/helm /usr/local/bin/

ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS
Expand Down
1 change: 1 addition & 0 deletions scripts/ci
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ cd $(dirname $0)
./test
./validate
./validate-ci
./validate-chart
./package
12 changes: 12 additions & 0 deletions scripts/validate-chart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

cd $(dirname $0)/..

app_version=$(yq e '.appVersion' charts/helm-project-operator/Chart.yaml)
image_tag=$(yq e '.image.tag' charts/helm-project-operator/values.yaml)

if [[ "${image_tag}" != "v${app_version}" ]]; then
echo "ERROR: .image.tag in charts/helm-project-operator/values.yaml (found: ${image_tag}) must match appVersion in charts/helm-project-operator/Chart.yaml (found ${app_version})"
exit 1
fi

0 comments on commit 257d57e

Please sign in to comment.