diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b15aa6e8..b8987023 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,12 +37,12 @@ jobs: with: version: v1.62.2 build: + name : CI Build strategy: matrix: arch: - x64 - arm64 - name : build runs-on : runs-on,image=ubuntu22-full-${{ matrix.arch }},runner=4cpu-linux-${{ matrix.arch }},run-id=${{ github.run_id }} steps: - name : Checkout repository diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1d42cae1..7735566c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,7 +14,7 @@ permissions: jobs: ci : - uses: rancher/backup-restore-operator/.github/workflows/ci.yaml@release/v5.0 + uses: .github/workflows/ci.yaml permissions: contents: read goreleaser: diff --git a/charts/rancher-backup/tests/deployment_test.yaml b/charts/rancher-backup/tests/deployment_test.yaml index 671d415d..b2ab19b8 100644 --- a/charts/rancher-backup/tests/deployment_test.yaml +++ b/charts/rancher-backup/tests/deployment_test.yaml @@ -200,6 +200,18 @@ tests: key: "example-key" operator: "Exists" effect: "NoSchedule" +- it: should allow image tag overrides + template: deployment.yaml + set: + image: + tag: v1.2.3-abc.42 + asserts: + - matchRegex: + path: spec.template.spec.containers[0].image + pattern: v1.2.3-abc.42$ + - notMatchRegex: + path: spec.template.spec.containers[0].image + pattern: v0.0.0-nope.1$ - it: should not set default imagePullSecrets template: deployment.yaml asserts: diff --git a/scripts/chart/test b/scripts/chart/test index ffb5b104..866aa133 100755 --- a/scripts/chart/test +++ b/scripts/chart/test @@ -2,6 +2,9 @@ echo "-- chart/test --" +echo "Must build charts first..." +$(dirname $0)/../package-helm + # skipping tests for s390x since helm v2 doesn't support s390x yet if [ "${ARCH}" == s390x ]; then exit 0 @@ -13,4 +16,5 @@ if [ -z "$(type -p helm)" ]; then exit 1 fi -helm unittest ../build/charts/rancher-backup +CHART_PATH=$(realpath $(dirname $0)/../../build/charts/rancher-backup) +helm unittest $CHART_PATH diff --git a/scripts/ci b/scripts/ci index 3ac7dc0e..ccb14ca9 100755 --- a/scripts/ci +++ b/scripts/ci @@ -3,6 +3,7 @@ set -e cd $(dirname $0) +./version ./test ./validate ./validate-ci diff --git a/scripts/clean-repo b/scripts/clean-repo new file mode 100755 index 00000000..eed5f33b --- /dev/null +++ b/scripts/clean-repo @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Cleaning BRO repo artifacts" + +if [[ -d ./build ]]; then + echo "Cleaning old build artifacts..." + rm -rf ./build +fi + +if [[ -d ./dist ]]; then + echo "Cleaning dist artifacts..." + rm -rf ./dist +fi \ No newline at end of file diff --git a/scripts/hull b/scripts/hull index 9156593c..3a867f5b 100755 --- a/scripts/hull +++ b/scripts/hull @@ -3,6 +3,10 @@ set -e function extract_version() { artifact_dir="$(dirname $0)/../dist/artifacts" + if [ ! -d "$artifact_dir" ]; then + $(dirname $0)/package-helm + fi + crdfilename=$( ls $artifact_dir | grep rancher-backup-crd ) regex="backup-crd-(.*)\\.tgz" if [[ $crdfilename =~ $regex ]]