Skip to content

Commit

Permalink
update repo docs without PR (#1498)
Browse files Browse the repository at this point in the history
* update repo docs without PR

* added docs

* include changelog to docs

* fixed duplication

* use single gpg

* pr comments
  • Loading branch information
AndrewChubatiuk authored Sep 19, 2024
1 parent 7ff6a0a commit 56af639
Show file tree
Hide file tree
Showing 60 changed files with 368 additions and 87 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- master

jobs:
release:
permissions:
issues: write
pull-requests: write
triage:
runs-on: ubuntu-latest
steps:
Expand Down
42 changes: 36 additions & 6 deletions .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,44 @@ jobs:

runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Import GPG key
- name: Check out VM code
uses: actions/checkout@v4
with:
repository: VictoriaMetrics/VictoriaMetrics
ref: master
token: ${{ secrets.VM_BOT_GH_TOKEN }}
path: __vm-repo

- name: Import GPG key for VM repo
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true

- name: Generate docs
run:
make gen-docs

- name: Copy docs
id: update
run: |
rsync -zarv \
--include="*/" \
--include="*.webp" \
--include="*.md" \
--exclude="*" \
charts/ ../__vm-repo/docs/helm/
cp *.md ../_vm-repo/docs/helm/
echo "BUILDTIME=$(date +%s)" >> $GITHUB_OUTPUT
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
cp -f README.md ${{ runner.temp }}/README.md
for readme in $(find charts/*/README.md)
do
Expand All @@ -52,15 +72,25 @@ jobs:

- name: Synchronize docs
run: |
export VM_GIT_BRANCH_NAME="docs-update-$(date +%s)"
git checkout -b "${VM_GIT_BRANCH_NAME}"
cp -f ${{ runner.temp }}/README.md .
cp -fr ${{ runner.temp }}/charts ./
git add README.md
git add charts/*/README.md
git commit -S -m "Synchronize docs"
git push origin ${VM_GIT_BRANCH_NAME}
gh pr create -f --base gh-pages
git push origin gh-pages
env:
GH_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
add-paths: docs/helm
commit-message: Automatic update helm docs from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }}
signoff: true
committer: "Github Actions <${{ steps.import-gpg.outputs.email }}>"
path: __vm-repo
branch: helm-docs-update-${{ steps.update.outputs.BUILDTIME }}
token: ${{ secrets.VM_BOT_GH_TOKEN }}
delete-branch: true
title: Automatic update helm docs from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }}
42 changes: 30 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ HELM_DOCS_IMAGE = jnorwood/helm-docs:v1.15-fork
CT_IMAGE = quay.io/helmpack/chart-testing:v3.11.0
HELM?=helm-docker
CT?=ct-docker
CONTAINER ?= docker
CONTAINER_TOOL ?= docker
REPODIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
WORKDIR := $(REPODIR)/..

include $(shell find charts -name Makefile)

ifeq ($(CONTAINER),docker)
ifeq ($(CONTAINER_TOOL),docker)
CONTAINER_USER_OPTION = --user $(shell id -u):$(shell id -g)
CONTAINER_VOLUME_OPTION_SUFFIX =
else
ifeq ($(CONTAINER),podman)
ifeq ($(CONTAINER_TOOL),podman)
CONTAINER_USER_OPTION =
CONTAINER_VOLUME_OPTION_SUFFIX = :z
else
Expand All @@ -21,7 +23,7 @@ endif

helm-docker:
mkdir -p .helm/cache
$(CONTAINER) run --rm --name helm-exec \
$(CONTAINER_TOOL) run --rm --name helm-exec \
$(CONTAINER_USER_OPTION) \
--volume "$(PWD):/helm-charts$(CONTAINER_VOLUME_OPTION_SUFFIX)" \
--volume "$(PWD)/.github/ci/helm-repos.yaml:/helm-charts/.helm/config/repositories.yaml$(CONTAINER_VOLUME_OPTION_SUFFIX)" \
Expand All @@ -38,7 +40,7 @@ helm-local:

ct-docker:
mkdir -p .helm/cache
$(CONTAINER) run --rm --name helm-exec \
$(CONTAINER_TOOL) run --rm --name helm-exec \
$(CONTAINER_USER_OPTION) \
--volume "$(PWD):/helm-charts$(CONTAINER_VOLUME_OPTION_SUFFIX)" \
--volume "$(PWD)/.github/ci/helm-repos.yaml:/helm-charts/.helm/config/repositories.yaml$(CONTAINER_VOLUME_OPTION_SUFFIX)" \
Expand Down Expand Up @@ -91,18 +93,34 @@ lint-local:
template-local:
HELM="helm-local" $(MAKE) template

init:
CMD="repo add prometheus-community https://prometheus-community.github.io/helm-charts" $(MAKE) $(HELM)
CMD="repo add grafana https://grafana.github.io/helm-charts" $(MAKE) $(HELM)
CMD="repo update" $(MAKE) $(HELM)

gen-docs:
$(CONTAINER) build $(PWD)/hack/docs \
$(CONTAINER_TOOL) build $(PWD)/hack/docs \
-t $(HELM_DOCS_IMAGE) && \
$(CONTAINER) run --rm \
$(CONTAINER_TOOL) run --rm \
$(CONTAINER_USER_OPTION) \
--volume "$(PWD):/helm-charts$(CONTAINER_VOLUME_OPTION_SUFFIX)" \
-w /helm-charts \
--entrypoint /bin/helm-docs \
$(HELM_DOCS_IMAGE) \
-t hack/docs/template.tmpl -t README.md.gotmpl

docs-image:
if [ ! -d $(WORKDIR)/vmdocs ]; then \
git clone --depth 1 [email protected]:VictoriaMetrics/vmdocs $(WORKDIR)/vmdocs; \
fi; \
cd $(WORKDIR)/vmdocs && \
git checkout main && \
git pull origin main && \
cd $(REPODIR) && \
$(CONTAINER_TOOL) build \
-t vmdocs \
$(WORKDIR)/vmdocs

docs-debug: docs-image gen-docs
$(CONTAINER_TOOL) run \
--rm \
--name vmdocs \
-p 1313:1313 \
-v ./:/opt/docs/content/helm \
$(foreach chart,$(wildcard charts/*), -v ./$(chart):/opt/docs/content/helm/$(basename $(chart))) \
vmdocs
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Victoria Metrics Helm Charts

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/search?repo=victoriametrics&verified_publisher=true)
[![License](https://img.shields.io/github/license/VictoriaMetrics/VictoriaMetrics.svg)](https://github.com/VictoriaMetrics/helm-charts/blob/master/LICENSE)
![Helm: v3](https://img.shields.io/static/v1?label=Helm&message=v3&color=informational&logo=helm)
Expand Down
11 changes: 11 additions & 0 deletions _index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
weight: 0
title: Helm Charts
menu:
docs:
weight: 0
aliases:
- /helm/
- /helm/index.html
---
{{% content "README.md" %}}
2 changes: 0 additions & 2 deletions charts/victoria-logs-single/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CHANGELOG for `victoria-logs-single` helm-chart

## Next release

- TODO
Expand Down
4 changes: 1 addition & 3 deletions charts/victoria-logs-single/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

# Victoria Logs Helm Chart for Single Version

![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-informational?style=flat-square)
![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-informational?style=flat-square)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-logs-single)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)

Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-logs-single/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Victoria Logs Helm Chart for Single Version

{{ template "chart.typeBadge" . }} {{ template "chart.versionBadge" . }}
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-logs-single)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
13 changes: 13 additions & 0 deletions charts/victoria-logs-single/_changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 1
title: CHANGELOG
menu:
docs:
weight: 1
identifier: helm-victoria-logs-single-changelog
parent: helm-victoria-logs-single
url: /helm/victoria-logs-single/changelog
aliases:
- /helm/victoria-logs-single/changelog/index.html
---
{{% content "CHANGELOG.md" %}}
13 changes: 13 additions & 0 deletions charts/victoria-logs-single/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 1
title: VictoriaLogs Single
menu:
docs:
parent: helm
weight: 1
identifier: helm-victorialogs-single
aliases:
- /helm/victorialogs-single/
- /helm/victorialogs-single/index.html
---
{{% content "README.md" %}}
2 changes: 0 additions & 2 deletions charts/victoria-metrics-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CHANGELOG for `victoria-metrics-agent` helm-chart

## Next release

- TODO
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

# Helm Chart For Victoria Metrics Agent.

![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.12.2](https://img.shields.io/badge/Version-0.12.2-informational?style=flat-square)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-agent)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-agent/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Helm Chart For Victoria Metrics Agent.

{{ template "chart.typeBadge" . }} {{ template "chart.versionBadge" . }}
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-agent)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
13 changes: 13 additions & 0 deletions charts/victoria-metrics-agent/_changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 1
title: CHANGELOG
menu:
docs:
weight: 1
identifier: helm-victoria-metrics-agent-changelog
parent: helm-victoria-metrics-agent
url: /helm/victoria-metrics-agent/changelog
aliases:
- /helm/victoria-metrics-agent/changelog/index.html
---
{{% content "CHANGELOG.md" %}}
13 changes: 13 additions & 0 deletions charts/victoria-metrics-agent/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 2
title: VictoriaMetrics Agent
menu:
docs:
parent: helm
weight: 2
identifier: helm-victoriametrics-agent
aliases:
- /helm/victoriametrics-agent/
- /helm/victoriametrics-agent/index.html
---
{{% content "README.md" %}}
2 changes: 0 additions & 2 deletions charts/victoria-metrics-alert/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CHANGELOG for `victoria-metrics-alert` helm-chart

## Next release

- TODO
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-alert/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

# Helm Chart For Victoria Metrics Alert.

![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.11.1](https://img.shields.io/badge/Version-0.11.1-informational?style=flat-square)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-alert)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-alert/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Helm Chart For Victoria Metrics Alert.

{{ template "chart.typeBadge" . }} {{ template "chart.versionBadge" . }}
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-alert)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
13 changes: 13 additions & 0 deletions charts/victoria-metrics-alert/_changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 1
title: CHANGELOG
menu:
docs:
weight: 1
identifier: helm-victoria-metrics-alert-changelog
parent: helm-victoria-metrics-alert
url: /helm/victoria-metrics-alert/changelog
aliases:
- /helm/victoria-metrics-alert/changelog/index.html
---
{{% content "CHANGELOG.md" %}}
13 changes: 13 additions & 0 deletions charts/victoria-metrics-alert/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 3
title: VictoriaMetrics Alert
menu:
docs:
parent: helm
weight: 3
identifier: helm-victoriametrics-alert
aliases:
- /helm/victoriametrics-alert/
- /helm/victoriametrics-alert/index.html
---
{{% content "README.md" %}}
2 changes: 0 additions & 2 deletions charts/victoria-metrics-anomaly/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CHANGELOG for `victoria-metrics-anomaly` helm-chart

## Next release

- TODO
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-anomaly/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

# Victoria Metrics Helm Chart for vmanomaly

![Version: 1.4.6](https://img.shields.io/badge/Version-1.4.6-informational?style=flat-square)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-anomaly)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-anomaly/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Victoria Metrics Helm Chart for vmanomaly

{{ template "chart.versionBadge" . }}
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-anomaly)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
13 changes: 13 additions & 0 deletions charts/victoria-metrics-anomaly/_changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 1
title: CHANGELOG
menu:
docs:
weight: 1
identifier: helm-victoria-metrics-anomaly-changelog
parent: helm-victoria-metrics-anomaly
url: /helm/victoria-metrics-anomaly/changelog
aliases:
- /helm/victoria-metrics-anomaly/changelog/index.html
---
{{% content "CHANGELOG.md" %}}
13 changes: 13 additions & 0 deletions charts/victoria-metrics-anomaly/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
weight: 4
title: VictoriaMetrics Anomaly
menu:
docs:
parent: helm
weight: 4
identifier: helm-victoriametrics-anomaly
aliases:
- /helm/victoriametrics-anomaly/
- /helm/victoriametrics-anomaly/index.html
---
{{% content "README.md" %}}
2 changes: 0 additions & 2 deletions charts/victoria-metrics-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# CHANGELOG for `victoria-metrics-auth` helm-chart

## Next release

- Added ability to override deployment namespace using `namespaceOverride` and `global.namespaceOverride` variables
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-auth/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

# Helm Chart For Victoria Metrics Auth.

![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-auth)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
2 changes: 0 additions & 2 deletions charts/victoria-metrics-auth/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Helm Chart For Victoria Metrics Auth.

{{ template "chart.typeBadge" . }} {{ template "chart.versionBadge" . }}
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-auth)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)
Expand Down
Loading

0 comments on commit 56af639

Please sign in to comment.