Skip to content

Commit 1d92e27

Browse files
committed
Merge branch 'main' into fix-cluster-id-label-in-mixins
Signed-off-by: QuentinBisson <[email protected]>
2 parents afbc08e + c4aa6ea commit 1d92e27

32 files changed

+6568
-5965
lines changed

.github/workflows/doc-validator.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
doc-validator:
88
runs-on: "ubuntu-latest"
99
container:
10-
image: "grafana/doc-validator:v4.0.0"
10+
image: "grafana/doc-validator:v5.0.0"
1111
steps:
1212
- name: "Checkout code"
13-
uses: "actions/checkout@v3"
13+
uses: "actions/checkout@v4"
1414
with:
1515
fetch-depth: 0
1616
- name: "Run doc-validator"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: operator-check-prepare-release-commit
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'operator/**'
7+
branches:
8+
- main
9+
10+
jobs:
11+
check-commit:
12+
runs-on: ubuntu-latest
13+
if: |
14+
github.event.pull_request.head.ref == 'release-please--branches--main--components--operator' &&
15+
contains(github.event.pull_request.title, 'chore( operator): community release')
16+
steps:
17+
- name: Extract release version
18+
id: pr_semver
19+
run: |
20+
PR_TITLE="${{ github.event.pull_request.title }}"
21+
SEMVER=$(echo "$PR_TITLE" | sed -n 's/^chore( operator): community release \([0-9]\+\.[0-9]\+\.[0-9]\+\)$/\1/p')
22+
echo "semver=$SEMVER" >> $GITHUB_OUTPUT
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
with:
27+
ref: main
28+
path: "release"
29+
30+
- name: Check main commits for prepare release commit
31+
id: check_commit
32+
env:
33+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
34+
working-directory: "release"
35+
run: |
36+
COMMIT=$(gh search commits "chore(operator): prepare community release v${{ steps.pr_semver.outputs.semver }}")
37+
if [ -n "$COMMIT" ]; then
38+
echo "Prepare release commit found."
39+
else
40+
echo "No prepare release commit found for the release version ${{ steps.pr_semver.outputs.semver }}"
41+
exit 1
42+
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: operator-release-please
2+
3+
on:
4+
push:
5+
paths:
6+
- 'operator/**'
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
releasePlease:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
release_created: ${{ steps.release.outputs.operator--release_created }}
19+
release_name: ${{ steps.release.outputs.operator--tag_name }}
20+
steps:
21+
- uses: google-github-actions/release-please-action@v4
22+
id: release
23+
with:
24+
path: operator
25+
config-file: operator/release-please-config.json
26+
token: ${{ secrets.GH_TOKEN }}
27+
publishRelease:
28+
needs:
29+
- "releasePlease"
30+
runs-on: ubuntu-latest
31+
if: ${{ needs.releasePlease.outputs.release_created }}
32+
steps:
33+
- name: "pull code to release"
34+
uses: "actions/checkout@v4"
35+
with:
36+
path: "release"
37+
- name: "publish release"
38+
env:
39+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
40+
working-directory: "release"
41+
run: |
42+
gh release edit "${{ needs.releasePlease.outputs.release_name }}" --draft=false --latest=false

.github/workflows/publish-technical-documentation-next.yml

+1-13
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,12 @@ on:
88
- "docs/sources/**"
99
workflow_dispatch:
1010
jobs:
11-
test:
12-
runs-on: "ubuntu-latest"
13-
steps:
14-
- name: "Check out code"
15-
uses: "actions/checkout@v3"
16-
- name: "Build website"
17-
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
18-
# that no refs to external content can be used as these refs will not resolve in the
19-
# docs-base image.
20-
run: |
21-
docker run -v ${PWD}/docs/sources:/hugo/content/docs/loki/next -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
22-
2311
sync:
2412
runs-on: "ubuntu-latest"
2513
needs: "test"
2614
steps:
2715
- name: "Check out code"
28-
uses: "actions/checkout@v3"
16+
uses: "actions/checkout@v4"
2917

3018
- name: "Clone website-sync Action"
3119
# WEBSITE_SYNC_TOKEN is a fine-grained GitHub Personal Access Token that expires.

.github/workflows/publish-technical-documentation-release.yml

+2-15
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,17 @@ on:
1010
- "docs/sources/**"
1111
workflow_dispatch:
1212
jobs:
13-
test:
14-
runs-on: "ubuntu-latest"
15-
steps:
16-
- name: "Check out code"
17-
uses: "actions/checkout@v3"
18-
- name:
19-
"Build website"
20-
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
21-
# that no refs to external content can be used as these refs will not resolve in the
22-
# docs-base image.
23-
run: |
24-
docker run -v ${PWD}/docs/sources:/hugo/content/docs/loki/release -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'make hugo'
25-
2613
sync:
2714
runs-on: "ubuntu-latest"
2815
needs: "test"
2916
steps:
3017
- name: "Checkout code and tags"
31-
uses: "actions/checkout@v3"
18+
uses: "actions/checkout@v4"
3219
with:
3320
fetch-depth: 0
3421

3522
- name: "Checkout Actions library"
36-
uses: "actions/checkout@v3"
23+
uses: "actions/checkout@v4"
3724
with:
3825
repository: "grafana/grafana-github-actions"
3926
path: "./actions"

.release-please-manifest.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
".": "3.0.0"
2+
".": "3.0.0",
3+
"operator": "0.6.0"
34
}

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ PROMTAIL_UI_FILES := $(shell find ./clients/pkg/promtail/server/ui -type f -name
8585

8686
# Documentation source path
8787
DOC_SOURCES_PATH := docs/sources
88+
DOC_TEMPLATE_PATH := docs/templates
8889

8990
# Configuration flags documentation
90-
DOC_FLAGS_TEMPLATE := $(DOC_SOURCES_PATH)/configure/index.template
91-
DOC_FLAGS := $(DOC_SOURCES_PATH)/configure/_index.md
91+
DOC_FLAGS_TEMPLATE := $(DOC_TEMPLATE_PATH)/configuration.template
92+
DOC_FLAGS := $(DOC_SOURCES_PATH)/shared/configuration.md
9293

9394
##########
9495
# Docker #

docs/docs.mk

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk.
2-
# 3.0.0 (2023-05-18)
2+
# A changelog is included in the head of the `make-docs` script.
33
include variables.mk
44
-include variables.mk.local
55

@@ -34,11 +34,6 @@ endif
3434
# First project is considered the primary one used for doc-validator.
3535
PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))
3636

37-
# Name for the container.
38-
ifeq ($(origin DOCS_CONTAINER), undefined)
39-
export DOCS_CONTAINER := $(PRIMARY_PROJECT)-docs
40-
endif
41-
4237
# Host port to publish container port to.
4338
ifeq ($(origin DOCS_HOST_PORT), undefined)
4439
export DOCS_HOST_PORT := 3002
@@ -76,44 +71,39 @@ docs-rm: ## Remove the docs container.
7671

7772
.PHONY: docs-pull
7873
docs-pull: ## Pull documentation base image.
79-
$(PODMAN) pull $(DOCS_IMAGE)
74+
$(PODMAN) pull -q $(DOCS_IMAGE)
8075

8176
make-docs: ## Fetch the latest make-docs script.
8277
make-docs:
83-
if [[ ! -f "$(PWD)/make-docs" ]]; then
78+
if [[ ! -f "$(CURDIR)/make-docs" ]]; then
8479
echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
8580
exit 1
8681
fi
8782

8883
.PHONY: docs
8984
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
9085
docs: docs-pull make-docs
91-
$(PWD)/make-docs $(PROJECTS)
86+
$(CURDIR)/make-docs $(PROJECTS)
9287

9388
.PHONY: docs-no-pull
9489
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
9590
docs-no-pull: make-docs
96-
$(PWD)/make-docs $(PROJECTS)
91+
$(CURDIR)/make-docs $(PROJECTS)
9792

9893
.PHONY: docs-debug
9994
docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
10095
docs-debug: make-docs
101-
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(PWD)/make-docs $(PROJECTS)
96+
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)
10297

10398
.PHONY: doc-validator
10499
doc-validator: ## Run doc-validator on the entire docs folder.
105100
doc-validator: make-docs
106-
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(PWD)/make-docs $(PROJECTS)
107-
108-
.PHONY: doc-validator/%
109-
doc-validator/%: ## Run doc-validator on a specific path. To lint the path /docs/sources/administration, run 'make doc-validator/administration'.
110-
doc-validator/%: make-docs
111-
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) DOC_VALIDATOR_INCLUDE=$(subst doc-validator/,,$@) $(PWD)/make-docs $(PROJECTS)
101+
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
112102

113103
.PHONY: vale
114104
vale: ## Run vale on the entire docs folder.
115105
vale: make-docs
116-
DOCS_IMAGE=$(VALE_IMAGE) $(PWD)/make-docs $(PROJECTS)
106+
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
117107

118108
.PHONY: update
119109
update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.

0 commit comments

Comments
 (0)