mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06: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:
parent
ed5d617cb9
commit
716bdde3f6
71
.drone.yml
71
.drone.yml
@ -179,13 +179,6 @@ steps:
|
|||||||
- rm words_to_ignore.txt
|
- rm words_to_ignore.txt
|
||||||
image: grafana/build-container:1.6.2
|
image: grafana/build-container:1.6.2
|
||||||
name: codespell
|
name: codespell
|
||||||
- commands:
|
|
||||||
- ./bin/build shellcheck
|
|
||||||
depends_on:
|
|
||||||
- grabpl
|
|
||||||
- compile-build-cmd
|
|
||||||
image: grafana/build-container:1.6.2
|
|
||||||
name: shellcheck
|
|
||||||
- commands:
|
- commands:
|
||||||
- make lint-go
|
- make lint-go
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -686,6 +679,47 @@ clone:
|
|||||||
retries: 3
|
retries: 3
|
||||||
depends_on: []
|
depends_on: []
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
name: pr-shellcheck
|
||||||
|
node:
|
||||||
|
type: no-parallel
|
||||||
|
platform:
|
||||||
|
arch: amd64
|
||||||
|
os: linux
|
||||||
|
services: []
|
||||||
|
steps:
|
||||||
|
- commands:
|
||||||
|
- go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd
|
||||||
|
depends_on: []
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
image: golang:1.19.1
|
||||||
|
name: compile-build-cmd
|
||||||
|
- commands:
|
||||||
|
- ./bin/build shellcheck
|
||||||
|
depends_on:
|
||||||
|
- compile-build-cmd
|
||||||
|
image: grafana/build-container:1.6.2
|
||||||
|
name: shellcheck
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- pull_request
|
||||||
|
paths:
|
||||||
|
exclude:
|
||||||
|
- '*.md'
|
||||||
|
- docs/**
|
||||||
|
- latest.json
|
||||||
|
include:
|
||||||
|
- scripts/**/*.sh
|
||||||
|
type: docker
|
||||||
|
volumes:
|
||||||
|
- host:
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
name: docker
|
||||||
|
---
|
||||||
|
clone:
|
||||||
|
retries: 3
|
||||||
|
depends_on: []
|
||||||
|
kind: pipeline
|
||||||
name: main-docs
|
name: main-docs
|
||||||
node:
|
node:
|
||||||
type: no-parallel
|
type: no-parallel
|
||||||
@ -899,13 +933,6 @@ steps:
|
|||||||
- rm words_to_ignore.txt
|
- rm words_to_ignore.txt
|
||||||
image: grafana/build-container:1.6.2
|
image: grafana/build-container:1.6.2
|
||||||
name: codespell
|
name: codespell
|
||||||
- commands:
|
|
||||||
- ./bin/build shellcheck
|
|
||||||
depends_on:
|
|
||||||
- grabpl
|
|
||||||
- compile-build-cmd
|
|
||||||
image: grafana/build-container:1.6.2
|
|
||||||
name: shellcheck
|
|
||||||
- commands:
|
- commands:
|
||||||
- make lint-go
|
- make lint-go
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -2044,13 +2071,6 @@ steps:
|
|||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
image: golang:1.19.1
|
image: golang:1.19.1
|
||||||
name: compile-build-cmd
|
name: compile-build-cmd
|
||||||
- commands:
|
|
||||||
- ./bin/build shellcheck
|
|
||||||
depends_on:
|
|
||||||
- grabpl
|
|
||||||
- compile-build-cmd
|
|
||||||
image: grafana/build-container:1.6.2
|
|
||||||
name: shellcheck
|
|
||||||
- commands:
|
- commands:
|
||||||
- |-
|
- |-
|
||||||
echo -e "unknwon
|
echo -e "unknwon
|
||||||
@ -3988,13 +4008,6 @@ steps:
|
|||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
image: golang:1.19.1
|
image: golang:1.19.1
|
||||||
name: compile-build-cmd
|
name: compile-build-cmd
|
||||||
- commands:
|
|
||||||
- ./bin/build shellcheck
|
|
||||||
depends_on:
|
|
||||||
- grabpl
|
|
||||||
- compile-build-cmd
|
|
||||||
image: grafana/build-container:1.6.2
|
|
||||||
name: shellcheck
|
|
||||||
- commands:
|
- commands:
|
||||||
- |-
|
- |-
|
||||||
echo -e "unknwon
|
echo -e "unknwon
|
||||||
@ -5114,6 +5127,6 @@ kind: secret
|
|||||||
name: packages_secret_access_key
|
name: packages_secret_access_key
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 4dab9811ddd4be2ca5cd598be69ce216e82406ca4197fdaeb75691156d356382
|
hmac: f8201ab7fe1632df9158ee66cc0a9bff140e9a7e4b2044b34b8e4e30d424aaad
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -34,6 +34,11 @@ load(
|
|||||||
'trigger_docs_pr',
|
'trigger_docs_pr',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
load(
|
||||||
|
'scripts/drone/pipelines/shellcheck.star',
|
||||||
|
'shellcheck_pipeline',
|
||||||
|
)
|
||||||
|
|
||||||
ver_mode = 'pr'
|
ver_mode = 'pr'
|
||||||
trigger = {
|
trigger = {
|
||||||
'event': [
|
'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),
|
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),
|
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),
|
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_backend_step',
|
||||||
'lint_frontend_step',
|
'lint_frontend_step',
|
||||||
'codespell_step',
|
'codespell_step',
|
||||||
'shellcheck_step',
|
|
||||||
'test_backend_step',
|
'test_backend_step',
|
||||||
'test_backend_integration_step',
|
'test_backend_integration_step',
|
||||||
'test_frontend_step',
|
'test_frontend_step',
|
||||||
@ -170,8 +169,6 @@ def get_steps(edition, ver_mode):
|
|||||||
]
|
]
|
||||||
|
|
||||||
test_steps = []
|
test_steps = []
|
||||||
if edition != 'enterprise':
|
|
||||||
test_steps.extend([shellcheck_step()])
|
|
||||||
|
|
||||||
test_steps.extend([
|
test_steps.extend([
|
||||||
codespell_step(),
|
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',
|
'download_grabpl_step',
|
||||||
'wire_install_step',
|
'wire_install_step',
|
||||||
'codespell_step',
|
'codespell_step',
|
||||||
'shellcheck_step',
|
|
||||||
'lint_backend_step',
|
'lint_backend_step',
|
||||||
'lint_drone_step',
|
'lint_drone_step',
|
||||||
'test_backend_step',
|
'test_backend_step',
|
||||||
@ -28,7 +27,6 @@ def test_backend(trigger, ver_mode):
|
|||||||
]
|
]
|
||||||
test_steps = [
|
test_steps = [
|
||||||
codespell_step(),
|
codespell_step(),
|
||||||
shellcheck_step(),
|
|
||||||
lint_backend_step(edition="oss"),
|
lint_backend_step(edition="oss"),
|
||||||
test_backend_step(edition="oss"),
|
test_backend_step(edition="oss"),
|
||||||
test_backend_integration_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):
|
def package_step(edition, ver_mode, include_enterprise2=False, variants=None):
|
||||||
deps = [
|
deps = [
|
||||||
'build-plugins',
|
'build-plugins',
|
||||||
|
Loading…
Reference in New Issue
Block a user