mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Drone: Check CUE dashboard schemas (#29334)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
10ff4eecef
commit
65ca47549d
388
.drone.yml
388
.drone.yml
File diff suppressed because it is too large
Load Diff
@ -73,14 +73,26 @@ RUN cd /tmp && \
|
||||
rm -rf /tmp/x86_64-centos6-linux-gnu/ && \
|
||||
rm -rf /tmp/crosstool-ng-${CTNG}
|
||||
|
||||
ARG GOLANGCILINT_VERSION=1.32.2
|
||||
ARG GOLANGCILINT_CHKSUM=e7ab86d833bf9faed39801ab3b5cd294f026d26f9a7da63a42390943ead486cc
|
||||
ARG GOLANGCILINT_VERSION=1.33.0
|
||||
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 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 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.
|
||||
# Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's.
|
||||
FROM debian:stretch-20201012
|
||||
@ -96,7 +108,9 @@ ENV GOVERSION=1.15.5 \
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
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 && \
|
||||
apt-get install -yq \
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
_version="1.2.29"
|
||||
_version="1.2.30"
|
||||
_tag="grafana/build-container:${_version}"
|
||||
|
||||
_dpath=$(dirname "${BASH_SOURCE[0]}")
|
||||
|
@ -1,5 +1,5 @@
|
||||
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'
|
||||
grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2'
|
||||
alpine_image = 'alpine:3.12'
|
||||
@ -510,22 +510,23 @@ def shellcheck_step():
|
||||
'depends_on': [
|
||||
'initialize',
|
||||
],
|
||||
'environment': {
|
||||
'VERSION': '0.7.1',
|
||||
'CHKSUM': 'beca3d7819a6bdcfbd044576df4fc284053b48f468b2f03428fe66f4ceb2c05d9b5411357fa15003cb0' +
|
||||
'311406c255084cf7283a3b8fce644c340c2f6aa910b9f',
|
||||
},
|
||||
'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',
|
||||
],
|
||||
}
|
||||
|
||||
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):
|
||||
if variants:
|
||||
variants_str = ' --variants {}'.format(','.join(variants))
|
||||
@ -592,6 +593,7 @@ def package_step(edition, ver_mode, variants=None, is_downstream=False):
|
||||
'test-frontend',
|
||||
'codespell',
|
||||
'shellcheck',
|
||||
'check-dashboard-schemas',
|
||||
],
|
||||
'environment': env,
|
||||
'commands': cmds,
|
||||
|
@ -4,6 +4,7 @@ load(
|
||||
'lint_backend_step',
|
||||
'codespell_step',
|
||||
'shellcheck_step',
|
||||
'dashboard_schemas_check',
|
||||
'test_backend_step',
|
||||
'test_frontend_step',
|
||||
'build_backend_step',
|
||||
@ -41,6 +42,7 @@ def get_steps(edition, is_downstream=False):
|
||||
lint_backend_step(edition),
|
||||
codespell_step(),
|
||||
shellcheck_step(),
|
||||
dashboard_schemas_check(),
|
||||
test_backend_step(),
|
||||
test_frontend_step(),
|
||||
frontend_metrics_step(edition=edition),
|
||||
|
@ -4,6 +4,7 @@ load(
|
||||
'lint_backend_step',
|
||||
'codespell_step',
|
||||
'shellcheck_step',
|
||||
'dashboard_schemas_check',
|
||||
'test_backend_step',
|
||||
'test_frontend_step',
|
||||
'build_backend_step',
|
||||
@ -33,6 +34,7 @@ def pr_pipelines(edition):
|
||||
lint_backend_step(edition),
|
||||
codespell_step(),
|
||||
shellcheck_step(),
|
||||
dashboard_schemas_check(),
|
||||
test_backend_step(),
|
||||
test_frontend_step(),
|
||||
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
|
||||
|
@ -7,6 +7,7 @@ load(
|
||||
'lint_backend_step',
|
||||
'codespell_step',
|
||||
'shellcheck_step',
|
||||
'dashboard_schemas_check',
|
||||
'test_backend_step',
|
||||
'test_frontend_step',
|
||||
'build_backend_step',
|
||||
@ -61,6 +62,7 @@ def get_steps(edition, ver_mode, publish):
|
||||
lint_backend_step(edition),
|
||||
codespell_step(),
|
||||
shellcheck_step(),
|
||||
dashboard_schemas_check(),
|
||||
test_backend_step(),
|
||||
test_frontend_step(),
|
||||
build_backend_step(edition=edition, ver_mode=ver_mode),
|
||||
|
Loading…
Reference in New Issue
Block a user