mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 02:32:19 +08:00
CI: Make shellcheck
a standalone pipeline (#55082)
* Make shellcheck standalone pipeline * Run shellcheck on every .sh change * Change base image * Trigger on script changes * Run shellcheck on PRs only
This commit is contained in:

committed by
GitHub

parent
ed5d617cb9
commit
716bdde3f6
@ -34,6 +34,11 @@ load(
|
||||
'trigger_docs_pr',
|
||||
)
|
||||
|
||||
load(
|
||||
'scripts/drone/pipelines/shellcheck.star',
|
||||
'shellcheck_pipeline',
|
||||
)
|
||||
|
||||
ver_mode = 'pr'
|
||||
trigger = {
|
||||
'event': [
|
||||
@ -56,7 +61,8 @@ def pr_pipelines(edition):
|
||||
test_backend(get_pr_trigger(include_paths=['pkg/**', 'packaging/**', '.drone.yml', 'conf/**', 'go.sum', 'go.mod', 'public/app/plugins/**/plugin.json', 'devenv/**']), ver_mode),
|
||||
build_e2e(trigger, ver_mode, edition),
|
||||
integration_tests(get_pr_trigger(include_paths=['pkg/**', 'packaging/**', '.drone.yml', 'conf/**', 'go.sum', 'go.mod', 'public/app/plugins/**/plugin.json']), ver_mode, edition),
|
||||
docs_pipelines(edition, ver_mode, trigger_docs_pr())
|
||||
docs_pipelines(edition, ver_mode, trigger_docs_pr()),
|
||||
shellcheck_pipeline(),
|
||||
]
|
||||
|
||||
|
||||
|
@ -13,7 +13,6 @@ load(
|
||||
'lint_backend_step',
|
||||
'lint_frontend_step',
|
||||
'codespell_step',
|
||||
'shellcheck_step',
|
||||
'test_backend_step',
|
||||
'test_backend_integration_step',
|
||||
'test_frontend_step',
|
||||
@ -170,8 +169,6 @@ def get_steps(edition, ver_mode):
|
||||
]
|
||||
|
||||
test_steps = []
|
||||
if edition != 'enterprise':
|
||||
test_steps.extend([shellcheck_step()])
|
||||
|
||||
test_steps.extend([
|
||||
codespell_step(),
|
||||
|
48
scripts/drone/pipelines/shellcheck.star
Normal file
48
scripts/drone/pipelines/shellcheck.star
Normal file
@ -0,0 +1,48 @@
|
||||
load(
|
||||
'scripts/drone/steps/lib.star',
|
||||
'build_image',
|
||||
'compile_build_cmd'
|
||||
)
|
||||
|
||||
load(
|
||||
'scripts/drone/utils/utils.star',
|
||||
'pipeline',
|
||||
)
|
||||
|
||||
trigger = {
|
||||
'event': [
|
||||
'pull_request',
|
||||
],
|
||||
'paths': {
|
||||
'exclude': [
|
||||
'*.md',
|
||||
'docs/**',
|
||||
'latest.json',
|
||||
],
|
||||
'include': [
|
||||
'scripts/**/*.sh'
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
def shellcheck_step():
|
||||
return {
|
||||
'name': 'shellcheck',
|
||||
'image': build_image,
|
||||
'depends_on': [
|
||||
'compile-build-cmd',
|
||||
],
|
||||
'commands': [
|
||||
'./bin/build shellcheck',
|
||||
],
|
||||
}
|
||||
|
||||
def shellcheck_pipeline():
|
||||
steps = [
|
||||
compile_build_cmd(),
|
||||
shellcheck_step(),
|
||||
]
|
||||
return pipeline(
|
||||
name='pr-shellcheck', edition="oss", trigger=trigger, services=[], steps=steps,
|
||||
)
|
||||
|
@ -4,7 +4,6 @@ load(
|
||||
'download_grabpl_step',
|
||||
'wire_install_step',
|
||||
'codespell_step',
|
||||
'shellcheck_step',
|
||||
'lint_backend_step',
|
||||
'lint_drone_step',
|
||||
'test_backend_step',
|
||||
@ -28,7 +27,6 @@ def test_backend(trigger, ver_mode):
|
||||
]
|
||||
test_steps = [
|
||||
codespell_step(),
|
||||
shellcheck_step(),
|
||||
lint_backend_step(edition="oss"),
|
||||
test_backend_step(edition="oss"),
|
||||
test_backend_integration_step(edition="oss"),
|
||||
|
@ -630,20 +630,6 @@ def codespell_step():
|
||||
}
|
||||
|
||||
|
||||
def shellcheck_step():
|
||||
return {
|
||||
'name': 'shellcheck',
|
||||
'image': build_image,
|
||||
'depends_on': [
|
||||
'grabpl',
|
||||
'compile-build-cmd',
|
||||
],
|
||||
'commands': [
|
||||
'./bin/build shellcheck',
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def package_step(edition, ver_mode, include_enterprise2=False, variants=None):
|
||||
deps = [
|
||||
'build-plugins',
|
||||
|
Reference in New Issue
Block a user