Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed May 31, 2024
1 parent 02a9b3d commit c5fca25
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
6 changes: 4 additions & 2 deletions .github/actions/e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions e2e/s3-to-rqlite/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 9 additions & 8 deletions scripts/build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kots-tag>"
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

0 comments on commit c5fca25

Please sign in to comment.