diff --git a/.github/actions/e2e/action.yml b/.github/actions/e2e/action.yml index ea3516f..72a0131 100644 --- a/.github/actions/e2e/action.yml +++ b/.github/actions/e2e/action.yml @@ -4,6 +4,9 @@ inputs: test-name: description: 'Individual test to run' required: true + chart-path: + description: 'Path to the chart to test' + required: true replicated-api-token: description: 'Replicated API token for C11y matrix' required: false @@ -25,8 +28,7 @@ runs: - name: Run test working-directory: e2e/${{ inputs.test-name }} env: - CHART_URL: oci://ttl.sh/automated-${{ github.run_id }}/admin-console - CHART_VERSION: 0.0.0-main + CHART_PATH: ${{ inputs.chart-path }} run: ./run.sh shell: bash diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 9847800..f78a7e7 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -8,13 +8,17 @@ jobs: build: name: Build runs-on: ubuntu-latest + outputs: + chart-path: ${{ steps.build.outputs.chart-path }} steps: - name: Checkout uses: actions/checkout@v4 - - name: ttl.sh - env: - GITHUB_USER: automated-${{ github.run_id }} - run: make build-ttl.sh + - name: build local + id: build + run: | + KOTS_TAG=$(gh release view --repo replicatedhq/kots --json tagName -q .tagName) + ./scripts/build-local.sh "$KOTS_TAG" + echo "chart-path=admin-console-${KOTS_TAG#v}.tgz" >> "$GITHUB_OUTPUT" e2e: runs-on: ubuntu-latest @@ -31,6 +35,7 @@ jobs: - uses: ./.github/actions/e2e with: test-name: ${{ matrix.test }} + chart-path: ${{ needs.build.outputs.chart-path }} replicated-api-token: ${{ secrets.C11Y_MATRIX_TOKEN }} # this job will validate that all the tests passed diff --git a/Makefile b/Makefile deleted file mode 100644 index c49e41d..0000000 --- a/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -.PHONY: build-ttl.sh -build-ttl.sh: - ./scripts/build-ttl.sh \ No newline at end of file diff --git a/README.md b/README.md index 9461716..dd53c4f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Run build-local.sh script located in the scripts directory of this repository to The input parameter is the kots version to package ``` -./scripts/build-local.sh 1.75.0 +./scripts/build-local.sh v1.75.0 ``` To build a chart that uses ttl images, run the build-ttl.sh script located in the scripts directory. diff --git a/e2e/s3-to-rqlite/run.sh b/e2e/s3-to-rqlite/run.sh index 9bb5851..151524f 100755 --- a/e2e/s3-to-rqlite/run.sh +++ b/e2e/s3-to-rqlite/run.sh @@ -20,14 +20,14 @@ curl -LO "https://github.com/replicatedhq/kots/releases/latest/download/kots_lin kubectl kots install s3-to-rqlite \ --namespace s3-to-rqlite \ --shared-password=password \ - --license-file=license.yaml + --license-file=license.yaml \ + --no-port-forward # wait for the app to be ready ../shared/wait-for-app.sh s3-to-rqlite # upgrade the chart -helm upgrade -i s3-to-rqlite "$CHART_URL" \ - --version "$CHART_VERSION" \ +helm upgrade -i s3-to-rqlite "$CHART_PATH" \ --namespace s3-to-rqlite \ --wait diff --git a/scripts/build-local.sh b/scripts/build-local.sh index 2f64180..4bc2871 100755 --- a/scripts/build-local.sh +++ b/scripts/build-local.sh @@ -2,20 +2,21 @@ set -e -export CURRENT_USER=${GITHUB_USER:-$(id -u -n)} -export KOTS_VERSION=$1 -export KOTS_TAG=v${KOTS_VERSION} +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +export KOTS_TAG=$1 export KOTSADM_REGISTRY=kotsadm # docker.io is implicit -export CHART_VERSION=${KOTS_VERSION} +export CHART_VERSION=${KOTS_TAG#v} -curl -O -L https://raw.githubusercontent.com/replicatedhq/kots/${KOTS_TAG}/.image.env +curl -O -L https://raw.githubusercontent.com/replicatedhq/kots/"${KOTS_TAG}"/.image.env export $(cat .image.env | sed 's/#.*//g' | xargs) envsubst < Chart.yaml.tmpl > Chart.yaml envsubst < values.yaml.tmpl > values.yaml rm -f admin-console-*.tgz -export CHART_NAME=`helm package . | rev | cut -d/ -f1 | rev` -helm push $CHART_NAME oci://ttl.sh/${CURRENT_USER} - +helm package . rm -f Chart.yaml values.yaml .image.env \ No newline at end of file