Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm releaser #289

Merged
merged 3 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
TF_DOCS_VERSION: v0.16.0
TFLINT_VERSION: v0.44.1
TF_VERSION: "1.3.4"
HELM_DOCS_VERSION: "1.7.0"
permissions:
contents: read
jobs:
Expand Down Expand Up @@ -42,6 +43,12 @@ jobs:
tar -zxvf terraform_docs.tar.gz terraform-docs
chmod +x terraform-docs
mv terraform-docs /usr/local/bin/
- name: Setup helm-docs
run: |
cd /tmp
wget https://github.com/norwoodj/helm-docs/releases/download/v${{env.HELM_DOCS_VERSION}}/helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
tar -xvf helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
sudo mv helm-docs /usr/local/sbin
- name: Pre-commit checks
uses: pre-commit/[email protected]
- name: pre-commit-ci-lite
Expand Down
45 changes: 41 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: "Install yq"
run: |
sudo snap install yq
Expand All @@ -19,11 +23,44 @@ jobs:
RELEASE_VERSION="${RELEASE_VERSION//v}"
# patch the version & appVersion in the Chart.yaml to the release version
yq eval -i ".version = \"$RELEASE_VERSION\", .appVersion = \"$RELEASE_VERSION\"" Chart.yaml
- uses: J12934/[email protected]
- name: install helm-docs
env:
HELM_DOCS_VERSION: "1.7.0"
run: |
cd /tmp
wget https://github.com/norwoodj/helm-docs/releases/download/v${{env.HELM_DOCS_VERSION}}/helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
tar -xvf helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz
sudo mv helm-docs /usr/local/sbin
- name: Generate and Release Helm Docs
run: |
helm-docs -t helm/wrongsecrets-ctf-party/README.md.gotmpl -t helm/wrongsecrets-ctf-party/_template.gotmpl -o README.md
cp helm/wrongsecrets-ctf-party/README.md /tmp/README.md
- name: Update gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
fetch-depth: 0
- name: Copy README.md to gh-pages
run: |
cp /tmp/README.md README.md
- name: Commit and push changes (if any)
run: |
if git diff --exit-code; then
echo "No changes detected."
else
echo "Changes detected."
git add README.md
git commit -m "Update README.md"
git push
fi
- name: Get back to original branch
uses: actions/checkout@v3
- name: Run chart-releaser
uses: helm/[email protected]
with:
access-token: ${{ secrets.ACCESS_TOKEN }}
charts-folder: helm
deploy-branch: gh-pages
charts_dir: helm
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
dockerBuilds:
name: "Build"
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ repos:
- "--args=--only=terraform_standard_module_structure"
- "--args=--only=terraform_workspace_remote"
- id: terraform_docs
- repo: https://github.com/norwoodj/helm-docs
rev: v1.2.0
hooks:
- id: helm-docs
args:
# Make the tool search for charts only under the `example-charts` directory
- --chart-search-root=helm

# The `./` makes it relative to the chart-search-root set above
- --template-files=./_templates.gotmpl

# Repeating the flag adds this to the list, now [./_templates.gotmpl, README.md.gotmpl]
# A base filename makes it relative to each chart directory found
- --template-files=README.md.gotmpl
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion helm/wrongsecrets-ctf-party/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: wrongsecrets-ctf-party
description: Run Multi User "Capture the Flags" or Security Trainings with OWASP Wrongsecrets
icon: https://github.com/OWASP/wrongsecrets/blob/master/icon.png?raw=true

home: https://github.com/
home: https://owasp.org/www-project-wrongsecrets/
sources:
- https://github.com/OWASP/wrongsecrets-ctf-party

Expand Down
Loading