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

switch markdownlint container to markdownlint-cli2 #619

Merged
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
9 changes: 9 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Reference: https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2yaml

config:
ul-indent:
# Kramdown wanted us to have 3 earlier, tho this CLI recommends 2 or 4
indent: 3

# Don't autofix anything, we're linting here
fix: false
7 changes: 4 additions & 3 deletions hack/markdownlint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/sh
# markdownlint-cli2 has config file(s) named .markdownlint-cli2.yaml in the repo

set -eux

IS_CONTAINER="${IS_CONTAINER:-false}"
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}"

# all md files, but ignore .github
if [ "${IS_CONTAINER}" != "false" ]; then
TOP_DIR="${1:-.}"
find "${TOP_DIR}" -type d \( -path ./vendor -o -path ./.github \) -prune -o -name '*.md' -exec mdl --style all --warnings {} \+
markdownlint-cli2 "**/*.md" "#.github"
else
"${CONTAINER_RUNTIME}" run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/workdir:ro,z" \
--entrypoint sh \
--workdir /workdir \
docker.io/pipelinecomponents/markdownlint:0.12.0@sha256:0b8f9fcf0410257b2f3548f67ffe25934cfc9877a618b9f85afcf345a25804a2 \
docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c \
/workdir/hack/markdownlint.sh "$@"
fi
5 changes: 3 additions & 2 deletions prow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ PACKER_VAR_FILES=var_file.json make build-openstack-ubuntu-2204
It will be referred to as `${HMAC_TOKEN}`.

1. Create a Jenkins token by logging in to Jenkins using the
metal3.bot@gmail.com account and adding an API token in the "Configure" tab
for the user. It will be referred to as `${JENKINS_TOKEN}`.
[metal3.bot@gmail.com](mailto:metal3.bot@gmail.com) account and adding an API
token in the "Configure" tab for the user. It will be referred to as
`${JENKINS_TOKEN}`.

## GitHub configuration

Expand Down
158 changes: 148 additions & 10 deletions prow/manifests/overlays/metal3/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
Nordix/metal3-dev-tools:
- name: shellcheck
Expand Down Expand Up @@ -378,7 +378,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
metal3-io/baremetal-operator:
- name: gofmt
Expand Down Expand Up @@ -424,6 +424,26 @@ presubmits:
image: docker.io/golang:1.20
imagePullPolicy: Always
- name: markdownlint
branches:
- main
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
containers:
- args:
- ./hack/markdownlint.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
- name: markdownlint
branches:
- release-0.5
- release-0.4
- release-0.3
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
Expand Down Expand Up @@ -695,6 +715,26 @@ presubmits:
image: docker.io/golang:1.19
imagePullPolicy: Always
- name: markdownlint
branches:
- main
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
containers:
- args:
- ./hack/markdownlint.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
- name: markdownlint
branches:
- release-1.6
- release-1.5
- release-1.4
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
Expand Down Expand Up @@ -854,7 +894,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
- name: shellcheck
run_if_changed: '((\.sh)|^Makefile)$'
Expand Down Expand Up @@ -898,7 +938,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always

metal3-io/project-infra:
Expand Down Expand Up @@ -931,7 +971,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
- name: shellcheck
run_if_changed: '((\.sh)|^Makefile)$'
Expand Down Expand Up @@ -961,7 +1001,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always

metal3-io/ip-address-manager:
Expand Down Expand Up @@ -1114,8 +1154,28 @@ presubmits:
value: "TRUE"
image: docker.io/golang:1.19
imagePullPolicy: Always
- name: markdownlint
branches:
- main
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
containers:
- args:
- ./hack/markdownlint.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
- name: markdownlint
run_if_changed: '(\.md|markdownlint\.sh)$'
branches:
- release-1.6
- release-1.5
- release-1.4
decorate: true
spec:
containers:
Expand Down Expand Up @@ -1252,7 +1312,37 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always

metal3-io/ironic-client:
- name: shellcheck
run_if_changed: '((\.sh)|^Makefile)$'
decorate: true
spec:
containers:
- args:
- ./hack/shellcheck.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/koalaman/shellcheck-alpine:v0.9.0@sha256:e19ed93c22423970d56568e171b4512c9244fc75dd9114045016b4a0073ac4b7
imagePullPolicy: Always
- name: markdownlint
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
containers:
- args:
- ./hack/markdownlint.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always

metal3-io/ironic-image:
Expand All @@ -1271,6 +1361,24 @@ presubmits:
image: docker.io/koalaman/shellcheck-alpine:v0.9.0@sha256:e19ed93c22423970d56568e171b4512c9244fc75dd9114045016b4a0073ac4b7
imagePullPolicy: Always
- name: markdownlint
branches:
- main
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
containers:
- args:
- ./hack/markdownlint.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
- name: markdownlint
branches:
- release-23.1
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
Expand Down Expand Up @@ -1312,7 +1420,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always

metal3-io/ironic-hardware-inventory-recorder-image:
Expand Down Expand Up @@ -1342,7 +1450,7 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always

metal3-io/utility-images:
Expand Down Expand Up @@ -1372,5 +1480,35 @@ presubmits:
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always

metal3-io/metal3-io.github.io:
- name: shellcheck
run_if_changed: '((\.sh)|^Makefile)$'
decorate: true
spec:
containers:
- args:
- ./hack/shellcheck.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/koalaman/shellcheck-alpine:v0.9.0@sha256:e19ed93c22423970d56568e171b4512c9244fc75dd9114045016b4a0073ac4b7
imagePullPolicy: Always
- name: markdownlint
run_if_changed: '(\.md|markdownlint\.sh)$'
decorate: true
spec:
containers:
- args:
- ./hack/markdownlint.sh
command:
- sh
env:
- name: IS_CONTAINER
value: "TRUE"
image: docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c
imagePullPolicy: Always
Loading