Commit 65ca4754 by Arve Knudsen Committed by GitHub

Drone: Check CUE dashboard schemas (#29334)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent 10ff4eec
...@@ -73,14 +73,26 @@ RUN cd /tmp && \ ...@@ -73,14 +73,26 @@ RUN cd /tmp && \
rm -rf /tmp/x86_64-centos6-linux-gnu/ && \ rm -rf /tmp/x86_64-centos6-linux-gnu/ && \
rm -rf /tmp/crosstool-ng-${CTNG} rm -rf /tmp/crosstool-ng-${CTNG}
ARG GOLANGCILINT_VERSION=1.32.2 ARG GOLANGCILINT_VERSION=1.33.0
ARG GOLANGCILINT_CHKSUM=e7ab86d833bf9faed39801ab3b5cd294f026d26f9a7da63a42390943ead486cc ARG GOLANGCILINT_CHKSUM=e2d6082f1df53c5d2c280765000f9e82783ea909ba419c6c4e172936b076031e
RUN curl -fLO https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz RUN curl -fLO https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz
RUN echo ${GOLANGCILINT_CHKSUM} golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz | sha256sum --check --strict --status RUN echo ${GOLANGCILINT_CHKSUM} golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz | sha256sum --check --strict --status
RUN tar xf golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz RUN tar xf golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64.tar.gz
RUN mv golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64/golangci-lint /tmp/ RUN mv golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64/golangci-lint /tmp/
ARG SHELLCHECK_VERSION=0.7.1
ARG SHELLCHECK_CHKSUM=beca3d7819a6bdcfbd044576df4fc284053b48f468b2f03428fe66f4ceb2c05d9b5411357fa15003cb0311406c255084cf7283a3b8fce644c340c2f6aa910b9f
RUN curl -fLO http://storage.googleapis.com/grafana-downloads/ci-dependencies/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz
RUN echo $SHELLCHECK_CHKSUM shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz | sha512sum --check --strict --status
RUN tar xf shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz && mv shellcheck-v${SHELLCHECK_VERSION}/shellcheck /tmp/
ARG CUE_VERSION=0.3.0-alpha5
ARG CUE_CHKSUM=9d3131e470cdb5182afd9966688f1c052d383145cce005a947156b5591da39b7
RUN curl -fLO https://github.com/cuelang/cue/releases/download/v${CUE_VERSION}/cue_${CUE_VERSION}_Linux_x86_64.tar.gz
RUN echo $CUE_CHKSUM cue_${CUE_VERSION}_Linux_x86_64.tar.gz | sha256sum --check --strict --status
RUN tar xf cue_${CUE_VERSION}_Linux_x86_64.tar.gz -C /tmp cue
# Base image to crossbuild grafana. # Base image to crossbuild grafana.
# Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's. # Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's.
FROM debian:stretch-20201012 FROM debian:stretch-20201012
...@@ -96,7 +108,9 @@ ENV GOVERSION=1.15.5 \ ...@@ -96,7 +108,9 @@ ENV GOVERSION=1.15.5 \
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
COPY --from=toolchain /tmp/x86_64-centos6-linux-gnu.tar.xz /tmp/osxcross.tar.xz /tmp/ COPY --from=toolchain /tmp/x86_64-centos6-linux-gnu.tar.xz /tmp/osxcross.tar.xz /tmp/
COPY --from=toolchain /tmp/golangci-lint /usr/local/bin COPY --from=toolchain /tmp/golangci-lint /usr/local/bin/
COPY --from=toolchain /tmp/shellcheck /usr/local/bin/
COPY --from=toolchain /tmp/cue /usr/local/bin/
RUN apt-get update && \ RUN apt-get update && \
apt-get install -yq \ apt-get install -yq \
......
#!/bin/bash #!/bin/bash
set -eo pipefail set -eo pipefail
_version="1.2.29" _version="1.2.30"
_tag="grafana/build-container:${_version}" _tag="grafana/build-container:${_version}"
_dpath=$(dirname "${BASH_SOURCE[0]}") _dpath=$(dirname "${BASH_SOURCE[0]}")
......
grabpl_version = '0.5.28' grabpl_version = '0.5.28'
build_image = 'grafana/build-container:1.2.29' build_image = 'grafana/build-container:1.2.30'
publish_image = 'grafana/grafana-ci-deploy:1.2.7' publish_image = 'grafana/grafana-ci-deploy:1.2.7'
grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2' grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2'
alpine_image = 'alpine:3.12' alpine_image = 'alpine:3.12'
...@@ -510,22 +510,23 @@ def shellcheck_step(): ...@@ -510,22 +510,23 @@ def shellcheck_step():
'depends_on': [ 'depends_on': [
'initialize', 'initialize',
], ],
'environment': {
'VERSION': '0.7.1',
'CHKSUM': 'beca3d7819a6bdcfbd044576df4fc284053b48f468b2f03428fe66f4ceb2c05d9b5411357fa15003cb0' +
'311406c255084cf7283a3b8fce644c340c2f6aa910b9f',
},
'commands': [ 'commands': [
'curl -fLO http://storage.googleapis.com/grafana-downloads/ci-dependencies/shellcheck-' +
'v$${VERSION}.linux.x86_64.tar.xz',
'echo $$CHKSUM shellcheck-v$${VERSION}.linux.x86_64.tar.xz | sha512sum --check --strict --status',
'tar xf shellcheck-v$${VERSION}.linux.x86_64.tar.xz',
'mv shellcheck-v$${VERSION}/shellcheck /usr/local/bin/',
'rm -rf shellcheck-v$${VERSION}*',
'./bin/grabpl shellcheck', './bin/grabpl shellcheck',
], ],
} }
def dashboard_schemas_check():
return {
'name': 'check-dashboard-schemas',
'image': build_image,
'depends_on': [
'initialize',
],
'commands': [
'cue export --out openapi -o - ./dashboard-schemas/...',
],
}
def package_step(edition, ver_mode, variants=None, is_downstream=False): def package_step(edition, ver_mode, variants=None, is_downstream=False):
if variants: if variants:
variants_str = ' --variants {}'.format(','.join(variants)) variants_str = ' --variants {}'.format(','.join(variants))
...@@ -592,6 +593,7 @@ def package_step(edition, ver_mode, variants=None, is_downstream=False): ...@@ -592,6 +593,7 @@ def package_step(edition, ver_mode, variants=None, is_downstream=False):
'test-frontend', 'test-frontend',
'codespell', 'codespell',
'shellcheck', 'shellcheck',
'check-dashboard-schemas',
], ],
'environment': env, 'environment': env,
'commands': cmds, 'commands': cmds,
......
...@@ -4,6 +4,7 @@ load( ...@@ -4,6 +4,7 @@ load(
'lint_backend_step', 'lint_backend_step',
'codespell_step', 'codespell_step',
'shellcheck_step', 'shellcheck_step',
'dashboard_schemas_check',
'test_backend_step', 'test_backend_step',
'test_frontend_step', 'test_frontend_step',
'build_backend_step', 'build_backend_step',
...@@ -41,6 +42,7 @@ def get_steps(edition, is_downstream=False): ...@@ -41,6 +42,7 @@ def get_steps(edition, is_downstream=False):
lint_backend_step(edition), lint_backend_step(edition),
codespell_step(), codespell_step(),
shellcheck_step(), shellcheck_step(),
dashboard_schemas_check(),
test_backend_step(), test_backend_step(),
test_frontend_step(), test_frontend_step(),
frontend_metrics_step(edition=edition), frontend_metrics_step(edition=edition),
......
...@@ -4,6 +4,7 @@ load( ...@@ -4,6 +4,7 @@ load(
'lint_backend_step', 'lint_backend_step',
'codespell_step', 'codespell_step',
'shellcheck_step', 'shellcheck_step',
'dashboard_schemas_check',
'test_backend_step', 'test_backend_step',
'test_frontend_step', 'test_frontend_step',
'build_backend_step', 'build_backend_step',
...@@ -33,6 +34,7 @@ def pr_pipelines(edition): ...@@ -33,6 +34,7 @@ def pr_pipelines(edition):
lint_backend_step(edition), lint_backend_step(edition),
codespell_step(), codespell_step(),
shellcheck_step(), shellcheck_step(),
dashboard_schemas_check(),
test_backend_step(), test_backend_step(),
test_frontend_step(), test_frontend_step(),
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants), build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
......
...@@ -7,6 +7,7 @@ load( ...@@ -7,6 +7,7 @@ load(
'lint_backend_step', 'lint_backend_step',
'codespell_step', 'codespell_step',
'shellcheck_step', 'shellcheck_step',
'dashboard_schemas_check',
'test_backend_step', 'test_backend_step',
'test_frontend_step', 'test_frontend_step',
'build_backend_step', 'build_backend_step',
...@@ -61,6 +62,7 @@ def get_steps(edition, ver_mode, publish): ...@@ -61,6 +62,7 @@ def get_steps(edition, ver_mode, publish):
lint_backend_step(edition), lint_backend_step(edition),
codespell_step(), codespell_step(),
shellcheck_step(), shellcheck_step(),
dashboard_schemas_check(),
test_backend_step(), test_backend_step(),
test_frontend_step(), test_frontend_step(),
build_backend_step(edition=edition, ver_mode=ver_mode), build_backend_step(edition=edition, ver_mode=ver_mode),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment