Skip to content

Commit

Permalink
chore: Introduced helm-docs (#1038)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
  • Loading branch information
kvanzuijlen and timja authored Mar 7, 2024
1 parent 464939b commit 5611c88
Show file tree
Hide file tree
Showing 18 changed files with 986 additions and 687 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ If you modified files in the `./charts/jenkins/` directory, please also include
- [ ] I bumped the "version" key in `./charts/jenkins/Chart.yaml`.
- [ ] I added a new changelog entry to `./charts/jenkins/CHANGELOG.md`.
- [ ] I followed the [technical requirements](https://github.com/jenkinsci/helm-charts/blob/main/CONTRIBUTING.md#technical-requirements).
- [ ] I ran .github/helm-docs.sh from the project root.
```

### Special notes for your reviewer
Expand Down
7 changes: 7 additions & 0 deletions .github/helm-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -euxo pipefail

# validate docs
cd charts/jenkins
helm-docs --template-files=VALUES.md.gotmpl --output-file=VALUES.md
2 changes: 1 addition & 1 deletion .github/renovate-config.json5
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
fileMatch: ["(^|/)\\.github/workflows/[^/]+\\.ya?ml$", "(^|/)\\.github/[^/]+\\.sh$"],
matchStrings: [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s+?[\\w\\s-]*?version:? (?<currentValue>.*)\\s",
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\sENV .*?_VERSION=(?<currentValue>.*)\\s",
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.*?_VERSION=(?<currentValue>.*)\\s",
],
},
{
Expand Down
8 changes: 8 additions & 0 deletions .github/renovate-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export HELM_UNITTEST_VERSION=v0.3.6
# renovate: datasource=github-tags depName=jenkins-x-plugins/jx-release-version
export JENKINS_JX_VERSION=v2.7.3

# renovate: datasource=github-releases depName=helm-docs packageName=norwoodj/helm-docs
export HELM_DOCS_VERSION=1.13.1

apt update

apt install -y curl git
Expand All @@ -31,4 +34,9 @@ mkdir -p /tmp/jx && tar -xf /tmp/jx-release.tar.gz -C /tmp/jx
mv /tmp/jx/jx-release-version /usr/local/bin/jx-release-version
chmod a+x /usr/local/bin/jx-release-version

curl -fsSL -o /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
mkdir -p /tmp/helm-docs && tar -xf /tmp/helm-docs.tar.gz -C /tmp/helm-docs
mv /tmp/helm-docs/helm-docs /usr/local/bin/helm-docs
chmod a+x /usr/local/bin/helm-docs

runuser -u ubuntu renovate
1 change: 1 addition & 0 deletions .github/renovate-postupgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export NEWVERSION="$2"
helm unittest --strict -f 'unittests/*.yaml' charts/jenkins -u
yq eval '.version = env(CHARTVERSION)' -i charts/jenkins/Chart.yaml
sed -i "/git commit to be able to get more details./a \\\n## ${CHARTVERSION}\n\nUpdate \`${DEPNAME}\` to version \`${NEWVERSION}\`" charts/jenkins/CHANGELOG.md
.github/helm-docs.sh
21 changes: 21 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,24 @@ jobs:
VALIDATE_YAML: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# copied from https://github.com/renovatebot/helm-charts
lint-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and run helm-docs
run: |-
# renovate: datasource=github-releases depName=helm-docs packageName=norwoodj/helm-docs
HELM_DOCS_VERSION=1.13.1
# install helm-docs
curl -fsSL -o /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
mkdir -p /tmp/helm-docs && tar -xf /tmp/helm-docs.tar.gz -C /tmp/helm-docs
mv /tmp/helm-docs/helm-docs /usr/local/bin/helm-docs
chmod a+x /usr/local/bin/helm-docs
.github/helm-docs.sh
- name: Check dirty state
run: git diff --exit-code
4 changes: 4 additions & 0 deletions charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
The changelog until v1.5.7 was auto-generated based on git commits.
Those entries include a reference to the git commit to be able to get more details.

## 5.0.19

Introduced helm-docs to automatically generate `values.yaml` documentation.

## 5.0.18

Update `kubernetes` to version `4193.vded98e56cc25`
Expand Down
9 changes: 6 additions & 3 deletions charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
apiVersion: v2
name: jenkins
home: https://jenkins.io/
version: 5.0.18
type: application
home: https://www.jenkins.io/
version: 5.0.19
appVersion: 2.440.1
description: Jenkins - Build great things at any scale! The leading open source automation server, Jenkins provides over 1800 plugins to support building, deploying and automating any project.
description: >
Jenkins - Build great things at any scale!
As the leading open source automation server, Jenkins provides over 1800 plugins to support building, deploying and automating any project.
sources:
- https://github.com/jenkinsci/jenkins
- https://github.com/jenkinsci/docker-inbound-agent
Expand Down
4 changes: 2 additions & 2 deletions charts/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ controller:
# the 'name' and 'keyName' are concatenated with a '-' in between, so for example:
# an existing secret "secret-credentials" and a key inside it named "github-password" should be used in Jcasc as ${secret-credentials-github-password}
# 'name' and 'keyName' must be lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-',
# and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc')
# and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc')
# existingSecret existing secret "secret-credentials" and a key inside it named "github-username" should be used in Jcasc as ${github-username}
# When using existingSecret no need to specify the keyName under additionalExistingSecrets.
existingSecret: secret-credentials
Expand Down Expand Up @@ -494,7 +494,7 @@ RBAC is enabled by default. If you want to disable it you will need to set `rbac

It is possible to add custom pod templates for the default configured kubernetes cloud.
Add a key under `agent.podTemplates` for each pod template. Each key (prior to `|` character) is just a label, and can be any value.
Keys are only used to give the pod template a meaningful name. The only restriction is they may only contain RFC 1123 \ DNS label characters: lowercase letters, numbers, and hyphens. Each pod template can contain multiple containers.
Keys are only used to give the pod template a meaningful name. The only restriction is they may only contain RFC 1123 \ DNS label characters: lowercase letters, numbers, and hyphens. Each pod template can contain multiple containers.
There's no need to add the _jnlp_ container since the kubernetes plugin will automatically inject it into the pod.
For this pod templates configuration to be loaded the following values must be set:

Expand Down
Loading

0 comments on commit 5611c88

Please sign in to comment.