diff --git a/.drone.yml b/.drone.yml index 94a155c6c65..4f44cf37c7c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -179,13 +179,6 @@ steps: - rm words_to_ignore.txt image: grafana/build-container:1.6.2 name: codespell -- commands: - - ./bin/build shellcheck - depends_on: - - grabpl - - compile-build-cmd - image: grafana/build-container:1.6.2 - name: shellcheck - commands: - make lint-go depends_on: @@ -686,6 +679,47 @@ clone: retries: 3 depends_on: [] 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 node: type: no-parallel @@ -899,13 +933,6 @@ steps: - rm words_to_ignore.txt image: grafana/build-container:1.6.2 name: codespell -- commands: - - ./bin/build shellcheck - depends_on: - - grabpl - - compile-build-cmd - image: grafana/build-container:1.6.2 - name: shellcheck - commands: - make lint-go depends_on: @@ -2044,13 +2071,6 @@ steps: CGO_ENABLED: 0 image: golang:1.19.1 name: compile-build-cmd -- commands: - - ./bin/build shellcheck - depends_on: - - grabpl - - compile-build-cmd - image: grafana/build-container:1.6.2 - name: shellcheck - commands: - |- echo -e "unknwon @@ -3988,13 +4008,6 @@ steps: CGO_ENABLED: 0 image: golang:1.19.1 name: compile-build-cmd -- commands: - - ./bin/build shellcheck - depends_on: - - grabpl - - compile-build-cmd - image: grafana/build-container:1.6.2 - name: shellcheck - commands: - |- echo -e "unknwon @@ -5114,6 +5127,6 @@ kind: secret name: packages_secret_access_key --- kind: signature -hmac: 4dab9811ddd4be2ca5cd598be69ce216e82406ca4197fdaeb75691156d356382 +hmac: f8201ab7fe1632df9158ee66cc0a9bff140e9a7e4b2044b34b8e4e30d424aaad ... diff --git a/scripts/drone/events/pr.star b/scripts/drone/events/pr.star index 1e24a3e6c72..5769f71e6f1 100644 --- a/scripts/drone/events/pr.star +++ b/scripts/drone/events/pr.star @@ -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(), ] diff --git a/scripts/drone/events/release.star b/scripts/drone/events/release.star index 34f6589980a..9b18ad5fe1f 100644 --- a/scripts/drone/events/release.star +++ b/scripts/drone/events/release.star @@ -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(), diff --git a/scripts/drone/pipelines/shellcheck.star b/scripts/drone/pipelines/shellcheck.star new file mode 100644 index 00000000000..808d7329ba9 --- /dev/null +++ b/scripts/drone/pipelines/shellcheck.star @@ -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, + ) + diff --git a/scripts/drone/pipelines/test_backend.star b/scripts/drone/pipelines/test_backend.star index 81267d8dae5..12b23e714da 100644 --- a/scripts/drone/pipelines/test_backend.star +++ b/scripts/drone/pipelines/test_backend.star @@ -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"), diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 489269dffff..8d1b5b0c20d 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -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',