diff --git a/scripts/validate-ci b/scripts/validate-ci index 92ef9974..b91da85e 100755 --- a/scripts/validate-ci +++ b/scripts/validate-ci @@ -1,18 +1,20 @@ #!/bin/bash set -e +source $(dirname $0)/version cd $(dirname $0)/.. +echo "[validate-ci] starting to validate" echo "Running go mod tidy" go mod tidy echo "Running go mod verify" go mod verify -echo "Verifying code is generated and repo is clean" -go generate - -source ./scripts/version +if [ -f "generate.go" ]; then + echo "Verifying code is generated and repo is clean" + go generate +fi if [ -n "$DIRTY" ]; then echo Git is dirty @@ -20,3 +22,5 @@ if [ -n "$DIRTY" ]; then git diff exit 1 fi + +echo "[validate-ci] success" diff --git a/scripts/version b/scripts/version index 27bbe191..be0311ab 100755 --- a/scripts/version +++ b/scripts/version @@ -1,5 +1,4 @@ #!/bin/bash -set -x CHARTS_BUILD_SCRIPTS_REPO=https://github.com/rancher/charts-build-scripts.git CHARTS_BUILD_SCRIPT_VERSION=v0.9.2 @@ -44,6 +43,7 @@ fi IMAGE=${IMAGE:-"$REPO/${BUILD_TARGET}:${TAG}"} function print_version_debug() { + echo "DIRTY: $DIRTY" echo "BUILD_TARGET: $BUILD_TARGET"; echo "SUFFIX: $SUFFIX"; echo "HELM_IMAGE_TAG: $HELM_IMAGE_TAG";