Skip to content

Commit

Permalink
helm: Move scripts to the parent of the chart directory
Browse files Browse the repository at this point in the history
There is no need to package these scripts together with the chart, so let's
move the out. I also made necessary adjustments to the scripts (paths).

Signed-off-by: Anna Kapuscinska <[email protected]>
  • Loading branch information
lambdanis committed Dec 5, 2023
1 parent 29dc69c commit af7133b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ assignees: ''

git checkout -b pr/prepare-$RELEASE
./contrib/update-helm-chart.sh $RELEASE
pushd install/kubernetes/tetragon
./test.sh
popd
./install/kubernetes/test.sh
git add install/kubernetes/tetragon/
# update hugo version
sed -i "s/^version =.*/version = \"${RELEASE}\"/" docs/hugo.toml
Expand Down
4 changes: 2 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"^make codegen$",
"^make generate$",
"^make vendor$",
"^install/kubernetes/tetragon/test.sh$",
"^install/kubernetes/test.sh$",
"^go mod vendor$",
"^install-tool golang \\$\\(grep -oP '\\^go \\\\K\\.\\+' go\\.mod\\)$"
],
Expand Down Expand Up @@ -240,7 +240,7 @@
],
// lint and generate files for helm chart
"postUpgradeTasks": {
"commands": ["install/kubernetes/tetragon/test.sh"],
"commands": ["install/kubernetes/test.sh"],
"fileFilters": ["**/**"],
"executionMode": "branch"
}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ on:
- main
- v*
paths:
- 'install/kubernetes/tetragon/**'
- 'install/kubernetes/**'
pull_request:
paths:
- 'install/kubernetes/tetragon/**'
- 'install/kubernetes/**'

jobs:
generated-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run install/kubernetes/tetragon/test.sh
- name: Run install/kubernetes/test.sh
run: |
cd install/kubernetes/tetragon && ./test.sh
install/kubernetes/test.sh
- name: Validate generated files
run: |
test -z "$(git status --porcelain)"
if [ $? != 0 ]; then
git status --porcelain
echo "Please run 'cd install/kubernetes/tetragon && ./test.sh' and submit your changes."; exit 1
echo "Please run 'install/kubernetes/test.sh' and submit your changes."; exit 1
fi
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ if [ -z "$1" ]; then
exit 1
fi

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
TETRAGON_CHART="$SCRIPT_DIR/tetragon"

TMP_FILE=$(mktemp)
trap "rm $TMP_FILE" EXIT

# use the generated proto documentation as source
cp README.md $TMP_FILE
cp "$TETRAGON_CHART/README.md" $TMP_FILE

# cleanup the generated documentation for the website
# remove the title
Expand Down Expand Up @@ -51,4 +54,3 @@ helm install tetragon cilium/tetragon -n kube-system
```
To use [the values available](#values), with `helm install` or `helm upgrade`, use `--set key=value`.' | cat - $TMP_FILE > $1

Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ set -e
set -o pipefail
shopt -s expand_aliases

# make this script executable from anywhere
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR
TETRAGON_CHART="$SCRIPT_DIR/tetragon"

alias helm='docker run --rm -v $(pwd):/apps alpine/helm:3.3.4'
alias helm='docker run --rm -v $TETRAGON_CHART:/apps alpine/helm:3.3.4'
alias kubeconform='docker run --rm -i ghcr.io/yannh/kubeconform:v0.6.4-alpine@sha256:e68a0b638c6e9b76f1b7d58b4ec94340ef3b6601db25b2e40b29e3ac2d68e4bf'
helm dependency update .
helm lint . --with-subcharts
helm template tetragon . | kubeconform --strict --schema-location default

# Update README.md.
docker run --rm -v "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.11.0@sha256:66c8f4164dec860fa5c1528239c4aa826a12485305b7b224594b1a73f7e6879a
./export-doc.sh ../../../docs/content/en/docs/reference/helm-chart.md
# Update README.md and documentation
docker run --rm -v "$TETRAGON_CHART:/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.11.0@sha256:66c8f4164dec860fa5c1528239c4aa826a12485305b7b224594b1a73f7e6879a
"$SCRIPT_DIR/export-doc.sh" "$SCRIPT_DIR/../../docs/content/en/docs/reference/helm-chart.md"

0 comments on commit af7133b

Please sign in to comment.