Files
grafana/scripts/drone/pipelines/docs.star
T

87 lines
1.7 KiB
Python
Raw Normal View History

"""
This module returns all the pipelines used in the event of documentation changes along with supporting functions.
"""
2022-02-21 13:55:16 +02:00
load(
"scripts/drone/steps/lib.star",
"build_docs_website_step",
"codespell_step",
"identify_runner_step",
"verify_gen_cue_step",
"yarn_install_step",
2022-02-21 13:55:16 +02:00
)
load(
"scripts/drone/utils/images.star",
"images",
)
2022-02-21 13:55:16 +02:00
load(
"scripts/drone/utils/utils.star",
"pipeline",
2022-02-21 13:55:16 +02:00
)
docs_paths = {
"include": [
"*.md",
"docs/**",
"packages/**/*.md",
"latest.json",
],
}
2022-02-21 13:55:16 +02:00
2022-12-07 02:13:57 -05:00
def docs_pipelines(ver_mode, trigger):
environment = {"EDITION": "oss"}
2022-04-14 14:56:14 +03:00
steps = [
identify_runner_step(),
yarn_install_step(),
codespell_step(),
lint_docs(),
2022-02-21 13:55:16 +02:00
build_docs_website_step(),
verify_gen_cue_step(),
2022-04-14 14:56:14 +03:00
]
2022-02-21 13:55:16 +02:00
return pipeline(
name = "{}-docs".format(ver_mode),
trigger = trigger,
services = [],
steps = steps,
environment = environment,
)
def lint_docs():
return {
"name": "lint-docs",
"image": images["node"],
"depends_on": [
"yarn-install",
],
"environment": {
"NODE_OPTIONS": "--max_old_space_size=8192",
},
"commands": [
"yarn run prettier:checkDocs",
],
}
def trigger_docs_main():
return {
"branch": "main",
"event": [
"push",
],
"repo": [
"grafana/grafana",
],
"paths": docs_paths,
}
def trigger_docs_pr():
return {
"event": [
"pull_request",
2022-02-21 13:55:16 +02:00
],
"repo": [
"grafana/grafana",
],
"paths": docs_paths,
2022-02-21 13:55:16 +02:00
}