2022-02-21 19:55:16 +08:00
|
|
|
load(
|
|
|
|
'scripts/drone/steps/lib.star',
|
2022-03-11 22:48:23 +08:00
|
|
|
'build_image',
|
2022-04-14 19:56:14 +08:00
|
|
|
'yarn_install_step',
|
|
|
|
'identify_runner_step',
|
2022-02-21 19:55:16 +08:00
|
|
|
'download_grabpl_step',
|
|
|
|
'lint_frontend_step',
|
|
|
|
'codespell_step',
|
|
|
|
'test_frontend_step',
|
|
|
|
'build_storybook_step',
|
|
|
|
'build_docs_website_step',
|
|
|
|
)
|
|
|
|
|
|
|
|
load(
|
|
|
|
'scripts/drone/services/services.star',
|
|
|
|
'integration_test_services',
|
|
|
|
'ldap_service',
|
|
|
|
)
|
|
|
|
|
|
|
|
load(
|
|
|
|
'scripts/drone/utils/utils.star',
|
|
|
|
'pipeline',
|
|
|
|
)
|
|
|
|
|
2022-08-03 20:08:43 +08:00
|
|
|
docs_paths = {
|
|
|
|
'include': [
|
|
|
|
'*.md',
|
|
|
|
'docs/**',
|
2022-08-10 18:39:56 +08:00
|
|
|
'packages/**/*.md',
|
2022-08-03 20:08:43 +08:00
|
|
|
'latest.json',
|
|
|
|
],
|
|
|
|
}
|
2022-02-21 19:55:16 +08:00
|
|
|
|
2022-02-23 02:06:14 +08:00
|
|
|
def docs_pipelines(edition, ver_mode, trigger):
|
2022-04-14 19:56:14 +08:00
|
|
|
steps = [
|
|
|
|
download_grabpl_step(),
|
|
|
|
identify_runner_step(),
|
|
|
|
yarn_install_step(),
|
2022-03-11 22:48:23 +08:00
|
|
|
codespell_step(),
|
|
|
|
lint_docs(),
|
2022-02-21 19:55:16 +08:00
|
|
|
build_docs_website_step(),
|
2022-04-14 19:56:14 +08:00
|
|
|
]
|
2022-02-21 19:55:16 +08:00
|
|
|
|
2022-02-23 02:06:14 +08:00
|
|
|
return pipeline(
|
|
|
|
name='{}-docs'.format(ver_mode), edition=edition, trigger=trigger, services=[], steps=steps,
|
|
|
|
)
|
|
|
|
|
2022-03-11 22:48:23 +08:00
|
|
|
def lint_docs():
|
|
|
|
return {
|
|
|
|
'name': 'lint-docs',
|
|
|
|
'image': build_image,
|
|
|
|
'depends_on': [
|
2022-04-14 19:56:14 +08:00
|
|
|
'yarn-install',
|
2022-03-11 22:48:23 +08:00
|
|
|
],
|
|
|
|
'environment': {
|
|
|
|
'NODE_OPTIONS': '--max_old_space_size=8192',
|
|
|
|
},
|
|
|
|
'commands': [
|
|
|
|
'yarn run prettier:checkDocs',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2022-02-23 02:06:14 +08:00
|
|
|
|
2022-08-03 20:08:43 +08:00
|
|
|
def trigger_docs_main():
|
|
|
|
return {
|
|
|
|
'branch': 'main',
|
|
|
|
'event': [
|
|
|
|
'push',
|
|
|
|
],
|
|
|
|
'paths': docs_paths,
|
|
|
|
}
|
|
|
|
|
|
|
|
def trigger_docs_pr():
|
2022-02-23 02:06:14 +08:00
|
|
|
return {
|
|
|
|
'event': [
|
2022-02-21 19:55:16 +08:00
|
|
|
'pull_request',
|
|
|
|
],
|
2022-08-03 20:08:43 +08:00
|
|
|
'paths': docs_paths,
|
2022-02-21 19:55:16 +08:00
|
|
|
}
|