mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
3506 lines
93 KiB
YAML
3506 lines
93 KiB
YAML
---
|
|
depends_on: []
|
|
kind: pipeline
|
|
name: test-pr
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
|
|
- yarn install --immutable
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition oss
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER}
|
|
--variants linux-x64,linux-x64-musl,osx64,win64,armv6 --no-pull-enterprise
|
|
depends_on:
|
|
- test-backend
|
|
environment: {}
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id
|
|
${DRONE_BUILD_NUMBER} --no-pull-enterprise
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps
|
|
depends_on:
|
|
- lint-backend
|
|
environment: null
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss
|
|
--build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise --variants linux-x64,linux-x64-musl,osx64,win64,armv6
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
environment: null
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PORT: 3001
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- yarn storybook:build
|
|
- ./bin/grabpl verify-storybook
|
|
depends_on:
|
|
- build-frontend
|
|
environment:
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
image: grafana/build-container:1.4.5
|
|
name: build-storybook
|
|
- commands:
|
|
- yarn wait-on http://$HOST:$PORT
|
|
- pa11y-ci --config .pa11yci-pr.conf.js
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GRAFANA_MISC_STATS_API_KEY:
|
|
from_secret: grafana_misc_stats_api_key
|
|
HOST: end-to-end-tests-server
|
|
PORT: 3001
|
|
failure: ignore
|
|
image: hugohaggmark/docker-puppeteer
|
|
name: test-a11y-frontend
|
|
- commands:
|
|
- ./scripts/ci-reference-docs-lint.sh ci
|
|
depends_on:
|
|
- build-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend-docs
|
|
- commands:
|
|
- mkdir -p /hugo/content/docs/grafana
|
|
- cp -r docs/sources/* /hugo/content/docs/grafana/latest/
|
|
- cd /hugo && make prod
|
|
depends_on:
|
|
- build-frontend-docs
|
|
image: grafana/docs-base:latest
|
|
name: build-docs-website
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
archs: amd64
|
|
dry_run: true
|
|
edition: oss
|
|
ubuntu: false
|
|
trigger:
|
|
event:
|
|
- pull_request
|
|
type: docker
|
|
---
|
|
depends_on: []
|
|
kind: pipeline
|
|
name: build-main
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
|
|
- yarn install --immutable
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- image: grafana/drone-downstream
|
|
name: trigger-enterprise-downstream
|
|
settings:
|
|
params:
|
|
- SOURCE_BUILD_NUMBER=${DRONE_BUILD_NUMBER}
|
|
- SOURCE_COMMIT=${DRONE_COMMIT}
|
|
repositories:
|
|
- grafana/grafana-enterprise@main
|
|
server: https://drone.grafana.net
|
|
token:
|
|
from_secret: drone_token
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition oss
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER}
|
|
--no-pull-enterprise
|
|
depends_on:
|
|
- test-backend
|
|
environment: {}
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id
|
|
${DRONE_BUILD_NUMBER} --no-pull-enterprise
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin
|
|
depends_on:
|
|
- lint-backend
|
|
environment:
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise
|
|
--sign
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PORT: 3001
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- yarn storybook:build
|
|
- ./bin/grabpl verify-storybook
|
|
depends_on:
|
|
- build-frontend
|
|
environment:
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
image: grafana/build-container:1.4.5
|
|
name: build-storybook
|
|
- commands:
|
|
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
|
|
- gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/canary
|
|
depends_on:
|
|
- build-storybook
|
|
- end-to-end-tests
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-storybook
|
|
- commands:
|
|
- yarn wait-on http://$HOST:$PORT
|
|
- pa11y-ci --config .pa11yci.conf.js --json > pa11y-ci-results.json
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GRAFANA_MISC_STATS_API_KEY:
|
|
from_secret: grafana_misc_stats_api_key
|
|
HOST: end-to-end-tests-server
|
|
PORT: 3001
|
|
failure: ignore
|
|
image: hugohaggmark/docker-puppeteer
|
|
name: test-a11y-frontend
|
|
- commands:
|
|
- ./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY}
|
|
depends_on:
|
|
- test-a11y-frontend
|
|
environment:
|
|
GRAFANA_MISC_STATS_API_KEY:
|
|
from_secret: grafana_misc_stats_api_key
|
|
failure: ignore
|
|
image: grafana/build-container:1.4.5
|
|
name: publish-frontend-metrics
|
|
- commands:
|
|
- ./scripts/ci-reference-docs-lint.sh ci
|
|
depends_on:
|
|
- build-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend-docs
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
dry_run: false
|
|
edition: oss
|
|
password:
|
|
from_secret: docker_password
|
|
ubuntu: false
|
|
username:
|
|
from_secret: docker_user
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images-ubuntu
|
|
settings:
|
|
dry_run: false
|
|
edition: oss
|
|
password:
|
|
from_secret: docker_password
|
|
ubuntu: true
|
|
username:
|
|
from_secret: docker_user
|
|
- commands:
|
|
- ./scripts/circle-release-canary-packages.sh
|
|
depends_on:
|
|
- end-to-end-tests
|
|
environment:
|
|
GITHUB_PACKAGE_TOKEN:
|
|
from_secret: github_package_token
|
|
image: grafana/build-container:1.4.5
|
|
name: release-canary-npm-packages
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition oss --packages-bucket grafana-downloads
|
|
depends_on:
|
|
- end-to-end-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition oss --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets
|
|
trigger:
|
|
branch: main
|
|
event:
|
|
- push
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- build-main
|
|
kind: pipeline
|
|
name: windows-main
|
|
platform:
|
|
arch: amd64
|
|
os: windows
|
|
version: "1809"
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- echo $env:DRONE_RUNNER_NAME
|
|
image: mcr.microsoft.com/windows:1809
|
|
name: identify-runner
|
|
- commands:
|
|
- $$ProgressPreference = "SilentlyContinue"
|
|
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/windows/grabpl.exe
|
|
-OutFile grabpl.exe
|
|
image: grafana/ci-wix:0.1.1
|
|
name: initialize
|
|
- commands:
|
|
- $$gcpKey = $$env:GCP_KEY
|
|
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
|
> gcpkey.json'
|
|
- dos2unix gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=gcpkey.json
|
|
- rm gcpkey.json
|
|
- cp C:\App\nssm-2.24.zip .
|
|
- .\grabpl.exe windows-installer --edition oss --build-id $$env:DRONE_BUILD_NUMBER
|
|
- $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]
|
|
- gsutil cp $$fname gs://grafana-downloads/oss/main/
|
|
- gsutil cp "$$fname.sha256" gs://grafana-downloads/oss/main/
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/ci-wix:0.1.1
|
|
name: build-windows-installer
|
|
trigger:
|
|
branch: main
|
|
event:
|
|
- push
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- build-main
|
|
- windows-main
|
|
kind: pipeline
|
|
name: publish-main
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
|
|
- ./bin/grabpl publish-packages --edition oss --gcp-key /tmp/gcpkey.json --build-id
|
|
${DRONE_BUILD_NUMBER}
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_COM_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-packages-oss
|
|
trigger:
|
|
branch: main
|
|
event:
|
|
- push
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- build-main
|
|
- windows-main
|
|
- publish-main
|
|
kind: pipeline
|
|
name: notify-main
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
steps:
|
|
- image: plugins/slack
|
|
name: slack
|
|
settings:
|
|
channel: grafana-ci-notifications
|
|
template: |-
|
|
Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}
|
|
Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>
|
|
Author: {{build.author}}
|
|
webhook:
|
|
from_secret: slack_webhook
|
|
trigger:
|
|
branch: main
|
|
event:
|
|
- push
|
|
status:
|
|
- failure
|
|
type: docker
|
|
---
|
|
depends_on: []
|
|
kind: pipeline
|
|
name: oss-build-release
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
- ./bin/grabpl verify-version ${DRONE_TAG}
|
|
- ./bin/grabpl gen-version ${DRONE_TAG}
|
|
- yarn install --immutable
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition oss
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition oss --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise ${DRONE_TAG}
|
|
depends_on:
|
|
- test-backend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps
|
|
--edition oss --no-pull-enterprise ${DRONE_TAG}
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin
|
|
depends_on:
|
|
- lint-backend
|
|
environment:
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition oss --github-token $${GITHUB_TOKEN} --no-pull-enterprise
|
|
--sign ${DRONE_TAG}
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PORT: 3001
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
dry_run: false
|
|
edition: oss
|
|
password:
|
|
from_secret: docker_password
|
|
ubuntu: false
|
|
username:
|
|
from_secret: docker_user
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images-ubuntu
|
|
settings:
|
|
dry_run: false
|
|
edition: oss
|
|
password:
|
|
from_secret: docker_password
|
|
ubuntu: true
|
|
username:
|
|
from_secret: docker_user
|
|
- commands:
|
|
- yarn storybook:build
|
|
- ./bin/grabpl verify-storybook
|
|
depends_on:
|
|
- build-frontend
|
|
environment:
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
image: grafana/build-container:1.4.5
|
|
name: build-storybook
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition oss --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition oss --packages-bucket grafana-downloads
|
|
depends_on:
|
|
- end-to-end-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages
|
|
- commands:
|
|
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
|
|
- gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/latest
|
|
- gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/${DRONE_TAG}
|
|
depends_on:
|
|
- build-storybook
|
|
- end-to-end-tests
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-storybook
|
|
- commands:
|
|
- ./scripts/build/release-packages.sh ${DRONE_TAG}
|
|
depends_on:
|
|
- publish-storybook
|
|
environment:
|
|
GITHUB_PACKAGE_TOKEN:
|
|
from_secret: github_package_token
|
|
NPM_TOKEN:
|
|
from_secret: npm_token
|
|
image: grafana/build-container:1.4.5
|
|
name: release-npm-packages
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-release
|
|
kind: pipeline
|
|
name: oss-windows-release
|
|
platform:
|
|
arch: amd64
|
|
os: windows
|
|
version: "1809"
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- echo $env:DRONE_RUNNER_NAME
|
|
image: mcr.microsoft.com/windows:1809
|
|
name: identify-runner
|
|
- commands:
|
|
- $$ProgressPreference = "SilentlyContinue"
|
|
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/windows/grabpl.exe
|
|
-OutFile grabpl.exe
|
|
image: grafana/ci-wix:0.1.1
|
|
name: initialize
|
|
- commands:
|
|
- $$gcpKey = $$env:GCP_KEY
|
|
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
|
> gcpkey.json'
|
|
- dos2unix gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=gcpkey.json
|
|
- rm gcpkey.json
|
|
- cp C:\App\nssm-2.24.zip .
|
|
- .\grabpl.exe windows-installer --edition oss ${DRONE_TAG}
|
|
- $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]
|
|
- gsutil cp $$fname gs://grafana-downloads/oss/release/
|
|
- gsutil cp "$$fname.sha256" gs://grafana-downloads/oss/release/
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/ci-wix:0.1.1
|
|
name: build-windows-installer
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
type: docker
|
|
---
|
|
clone:
|
|
disable: true
|
|
depends_on: []
|
|
image_pull_secrets:
|
|
- dockerconfigjson
|
|
kind: pipeline
|
|
name: enterprise-build-release
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
- environment: {}
|
|
image: redis:6.2.1-alpine
|
|
name: redis
|
|
- environment: {}
|
|
image: memcached:1.6.9-alpine
|
|
name: memcached
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
|
|
- cd grafana-enterprise
|
|
- git checkout ${DRONE_TAG}
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: clone
|
|
- commands:
|
|
- mv bin/grabpl /tmp/
|
|
- rmdir bin
|
|
- mv grafana-enterprise /tmp/
|
|
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise ${DRONE_TAG}
|
|
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
|
|
- mkdir bin
|
|
- mv /tmp/grabpl bin/
|
|
- make gen-go
|
|
- ./bin/grabpl verify-version ${DRONE_TAG}
|
|
- ./bin/grabpl gen-version ${DRONE_TAG}
|
|
- yarn install --immutable
|
|
depends_on:
|
|
- grabpl
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition enterprise
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition enterprise
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition enterprise
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise ${DRONE_TAG}
|
|
depends_on:
|
|
- test-backend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps
|
|
--edition enterprise --no-pull-enterprise ${DRONE_TAG}
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition enterprise --no-install-deps --sign
|
|
--signing-admin
|
|
depends_on:
|
|
- lint-backend
|
|
environment:
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition enterprise2
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition enterprise2
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition enterprise2
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise ${DRONE_TAG}
|
|
depends_on:
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise --sign ${DRONE_TAG}
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
- build-backend-enterprise2
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PACKAGE_FILE: dist/grafana-enterprise-*linux-amd64.tar.gz
|
|
PORT: 3001
|
|
RUNDIR: e2e/tmp-grafana-enterprise
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
dry_run: false
|
|
edition: enterprise
|
|
password:
|
|
from_secret: docker_password
|
|
ubuntu: false
|
|
username:
|
|
from_secret: docker_user
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images-ubuntu
|
|
settings:
|
|
dry_run: false
|
|
edition: enterprise
|
|
password:
|
|
from_secret: docker_password
|
|
ubuntu: true
|
|
username:
|
|
from_secret: docker_user
|
|
- commands:
|
|
- dockerize -wait tcp://redis:6379/0 -timeout 120s
|
|
- ./bin/grabpl integration-tests
|
|
depends_on:
|
|
- test-backend
|
|
- test-frontend
|
|
environment:
|
|
REDIS_URL: redis://redis:6379/0
|
|
image: grafana/build-container:1.4.5
|
|
name: redis-integration-tests
|
|
- commands:
|
|
- dockerize -wait tcp://memcached:11211 -timeout 120s
|
|
- ./bin/grabpl integration-tests
|
|
depends_on:
|
|
- test-backend
|
|
- test-frontend
|
|
environment:
|
|
MEMCACHED_HOSTS: memcached:11211
|
|
image: grafana/build-container:1.4.5
|
|
name: memcached-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition enterprise --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition enterprise --packages-bucket grafana-downloads
|
|
depends_on:
|
|
- end-to-end-tests
|
|
- redis-integration-tests
|
|
- memcached-integration-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise --sign ${DRONE_TAG}
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
- build-backend-enterprise2
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package-enterprise2
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package-enterprise2
|
|
detach: true
|
|
environment:
|
|
PACKAGE_FILE: dist/grafana-enterprise2-*linux-amd64.tar.gz
|
|
PORT: 3002
|
|
RUNDIR: e2e/tmp-grafana-enterprise2
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server-enterprise2
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3002 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server-enterprise2
|
|
environment:
|
|
HOST: end-to-end-tests-server-enterprise2
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition enterprise2 --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server-enterprise2
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition enterprise2 --packages-bucket grafana-downloads-enterprise2
|
|
depends_on:
|
|
- end-to-end-tests-enterprise2
|
|
- redis-integration-tests
|
|
- memcached-integration-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages-enterprise2
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
type: docker
|
|
---
|
|
clone:
|
|
disable: true
|
|
depends_on:
|
|
- enterprise-build-release
|
|
image_pull_secrets:
|
|
- dockerconfigjson
|
|
kind: pipeline
|
|
name: enterprise-windows-release
|
|
platform:
|
|
arch: amd64
|
|
os: windows
|
|
version: "1809"
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- echo $env:DRONE_RUNNER_NAME
|
|
image: mcr.microsoft.com/windows:1809
|
|
name: identify-runner
|
|
- commands:
|
|
- $$ProgressPreference = "SilentlyContinue"
|
|
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/windows/grabpl.exe
|
|
-OutFile grabpl.exe
|
|
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
|
|
- cd grafana-enterprise
|
|
- git checkout ${DRONE_TAG}
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/ci-wix:0.1.1
|
|
name: clone
|
|
- commands:
|
|
- cp -r grafana-enterprise C:\App\grafana-enterprise
|
|
- rm -r -force grafana-enterprise
|
|
- cp grabpl.exe C:\App\grabpl.exe
|
|
- rm -force grabpl.exe
|
|
- C:\App\grabpl.exe init-enterprise C:\App\grafana-enterprise
|
|
- cp C:\App\grabpl.exe grabpl.exe
|
|
depends_on:
|
|
- clone
|
|
image: grafana/ci-wix:0.1.1
|
|
name: initialize
|
|
- commands:
|
|
- $$gcpKey = $$env:GCP_KEY
|
|
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
|
> gcpkey.json'
|
|
- dos2unix gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=gcpkey.json
|
|
- rm gcpkey.json
|
|
- cp C:\App\nssm-2.24.zip .
|
|
- .\grabpl.exe windows-installer --edition enterprise ${DRONE_TAG}
|
|
- $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]
|
|
- gsutil cp $$fname gs://grafana-downloads/enterprise/release/
|
|
- gsutil cp "$$fname.sha256" gs://grafana-downloads/enterprise/release/
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/ci-wix:0.1.1
|
|
name: build-windows-installer
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-release
|
|
- oss-windows-release
|
|
- enterprise-build-release
|
|
- enterprise-windows-release
|
|
kind: pipeline
|
|
name: publish-release
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
- ./bin/grabpl verify-version ${DRONE_TAG}
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
|
|
- ./bin/grabpl publish-packages --edition oss --gcp-key /tmp/gcpkey.json ${DRONE_TAG}
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_COM_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-packages-oss
|
|
- commands:
|
|
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
|
|
- ./bin/grabpl publish-packages --edition enterprise --gcp-key /tmp/gcpkey.json
|
|
${DRONE_TAG}
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_COM_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-packages-enterprise
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-release
|
|
- oss-windows-release
|
|
- enterprise-build-release
|
|
- enterprise-windows-release
|
|
- publish-release
|
|
kind: pipeline
|
|
name: notify-release
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
steps:
|
|
- image: plugins/slack
|
|
name: slack
|
|
settings:
|
|
channel: grafana-ci-notifications
|
|
template: |-
|
|
Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}
|
|
Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>
|
|
Author: {{build.author}}
|
|
webhook:
|
|
from_secret: slack_webhook
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
status:
|
|
- failure
|
|
type: docker
|
|
---
|
|
depends_on: []
|
|
kind: pipeline
|
|
name: oss-build-test-release
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
- ./bin/grabpl verify-version v7.3.0-test
|
|
- ./bin/grabpl gen-version v7.3.0-test
|
|
- yarn install --immutable
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition oss
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition oss --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise v7.3.0-test
|
|
depends_on:
|
|
- test-backend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps
|
|
--edition oss --no-pull-enterprise v7.3.0-test
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin
|
|
depends_on:
|
|
- lint-backend
|
|
environment:
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition oss --github-token $${GITHUB_TOKEN} --no-pull-enterprise
|
|
--sign v7.3.0-test
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PORT: 3001
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
dry_run: true
|
|
edition: oss
|
|
ubuntu: false
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images-ubuntu
|
|
settings:
|
|
dry_run: true
|
|
edition: oss
|
|
ubuntu: true
|
|
- commands:
|
|
- yarn storybook:build
|
|
- ./bin/grabpl verify-storybook
|
|
depends_on:
|
|
- build-frontend
|
|
environment:
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
image: grafana/build-container:1.4.5
|
|
name: build-storybook
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition oss --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition oss --packages-bucket grafana-downloads-test
|
|
depends_on:
|
|
- end-to-end-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages
|
|
- commands:
|
|
- echo Testing release
|
|
depends_on:
|
|
- build-storybook
|
|
- end-to-end-tests
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-storybook
|
|
- commands: []
|
|
depends_on:
|
|
- publish-storybook
|
|
environment:
|
|
GITHUB_PACKAGE_TOKEN:
|
|
from_secret: github_package_token
|
|
NPM_TOKEN:
|
|
from_secret: npm_token
|
|
image: grafana/build-container:1.4.5
|
|
name: release-npm-packages
|
|
trigger:
|
|
event:
|
|
- custom
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-test-release
|
|
kind: pipeline
|
|
name: oss-windows-test-release
|
|
platform:
|
|
arch: amd64
|
|
os: windows
|
|
version: "1809"
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- echo $env:DRONE_RUNNER_NAME
|
|
image: mcr.microsoft.com/windows:1809
|
|
name: identify-runner
|
|
- commands:
|
|
- $$ProgressPreference = "SilentlyContinue"
|
|
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/windows/grabpl.exe
|
|
-OutFile grabpl.exe
|
|
image: grafana/ci-wix:0.1.1
|
|
name: initialize
|
|
- commands:
|
|
- $$gcpKey = $$env:GCP_KEY
|
|
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
|
> gcpkey.json'
|
|
- dos2unix gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=gcpkey.json
|
|
- rm gcpkey.json
|
|
- cp C:\App\nssm-2.24.zip .
|
|
- .\grabpl.exe windows-installer --edition oss --packages-bucket grafana-downloads-test
|
|
v7.3.0-test
|
|
- $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]
|
|
- gsutil cp $$fname gs://grafana-downloads-test/oss/release/
|
|
- gsutil cp "$$fname.sha256" gs://grafana-downloads-test/oss/release/
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/ci-wix:0.1.1
|
|
name: build-windows-installer
|
|
trigger:
|
|
event:
|
|
- custom
|
|
type: docker
|
|
---
|
|
clone:
|
|
disable: true
|
|
depends_on: []
|
|
image_pull_secrets:
|
|
- dockerconfigjson
|
|
kind: pipeline
|
|
name: enterprise-build-test-release
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
- environment: {}
|
|
image: redis:6.2.1-alpine
|
|
name: redis
|
|
- environment: {}
|
|
image: memcached:1.6.9-alpine
|
|
name: memcached
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
|
|
- cd grafana-enterprise
|
|
- git checkout main
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: clone
|
|
- commands:
|
|
- mv bin/grabpl /tmp/
|
|
- rmdir bin
|
|
- mv grafana-enterprise /tmp/
|
|
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
|
|
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
|
|
- mkdir bin
|
|
- mv /tmp/grabpl bin/
|
|
- make gen-go
|
|
- ./bin/grabpl verify-version v7.3.0-test
|
|
- ./bin/grabpl gen-version v7.3.0-test
|
|
- yarn install --immutable
|
|
depends_on:
|
|
- grabpl
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition enterprise
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition enterprise
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition enterprise
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise v7.3.0-test
|
|
depends_on:
|
|
- test-backend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps
|
|
--edition enterprise --no-pull-enterprise v7.3.0-test
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition enterprise --no-install-deps --sign
|
|
--signing-admin
|
|
depends_on:
|
|
- lint-backend
|
|
environment:
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition enterprise2
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition enterprise2
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition enterprise2
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise v7.3.0-test
|
|
depends_on:
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise --sign v7.3.0-test
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
- build-backend-enterprise2
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PACKAGE_FILE: dist/grafana-enterprise-*linux-amd64.tar.gz
|
|
PORT: 3001
|
|
RUNDIR: e2e/tmp-grafana-enterprise
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
dry_run: true
|
|
edition: enterprise
|
|
ubuntu: false
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images-ubuntu
|
|
settings:
|
|
dry_run: true
|
|
edition: enterprise
|
|
ubuntu: true
|
|
- commands:
|
|
- dockerize -wait tcp://redis:6379/0 -timeout 120s
|
|
- ./bin/grabpl integration-tests
|
|
depends_on:
|
|
- test-backend
|
|
- test-frontend
|
|
environment:
|
|
REDIS_URL: redis://redis:6379/0
|
|
image: grafana/build-container:1.4.5
|
|
name: redis-integration-tests
|
|
- commands:
|
|
- dockerize -wait tcp://memcached:11211 -timeout 120s
|
|
- ./bin/grabpl integration-tests
|
|
depends_on:
|
|
- test-backend
|
|
- test-frontend
|
|
environment:
|
|
MEMCACHED_HOSTS: memcached:11211
|
|
image: grafana/build-container:1.4.5
|
|
name: memcached-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition enterprise --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition enterprise --packages-bucket grafana-downloads-test
|
|
depends_on:
|
|
- end-to-end-tests
|
|
- redis-integration-tests
|
|
- memcached-integration-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN}
|
|
--no-pull-enterprise --sign v7.3.0-test
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
- build-backend-enterprise2
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package-enterprise2
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package-enterprise2
|
|
detach: true
|
|
environment:
|
|
PACKAGE_FILE: dist/grafana-enterprise2-*linux-amd64.tar.gz
|
|
PORT: 3002
|
|
RUNDIR: e2e/tmp-grafana-enterprise2
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server-enterprise2
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3002 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server-enterprise2
|
|
environment:
|
|
HOST: end-to-end-tests-server-enterprise2
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition enterprise2 --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server-enterprise2
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition enterprise2 --packages-bucket grafana-downloads-test
|
|
depends_on:
|
|
- end-to-end-tests-enterprise2
|
|
- redis-integration-tests
|
|
- memcached-integration-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages-enterprise2
|
|
trigger:
|
|
event:
|
|
- custom
|
|
type: docker
|
|
---
|
|
clone:
|
|
disable: true
|
|
depends_on:
|
|
- enterprise-build-test-release
|
|
image_pull_secrets:
|
|
- dockerconfigjson
|
|
kind: pipeline
|
|
name: enterprise-windows-test-release
|
|
platform:
|
|
arch: amd64
|
|
os: windows
|
|
version: "1809"
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- echo $env:DRONE_RUNNER_NAME
|
|
image: mcr.microsoft.com/windows:1809
|
|
name: identify-runner
|
|
- commands:
|
|
- $$ProgressPreference = "SilentlyContinue"
|
|
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/windows/grabpl.exe
|
|
-OutFile grabpl.exe
|
|
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
|
|
- cd grafana-enterprise
|
|
- git checkout main
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/ci-wix:0.1.1
|
|
name: clone
|
|
- commands:
|
|
- cp -r grafana-enterprise C:\App\grafana-enterprise
|
|
- rm -r -force grafana-enterprise
|
|
- cp grabpl.exe C:\App\grabpl.exe
|
|
- rm -force grabpl.exe
|
|
- C:\App\grabpl.exe init-enterprise C:\App\grafana-enterprise
|
|
- cp C:\App\grabpl.exe grabpl.exe
|
|
depends_on:
|
|
- clone
|
|
image: grafana/ci-wix:0.1.1
|
|
name: initialize
|
|
- commands:
|
|
- $$gcpKey = $$env:GCP_KEY
|
|
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
|
> gcpkey.json'
|
|
- dos2unix gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=gcpkey.json
|
|
- rm gcpkey.json
|
|
- cp C:\App\nssm-2.24.zip .
|
|
- .\grabpl.exe windows-installer --edition enterprise --packages-bucket grafana-downloads-test
|
|
v7.3.0-test
|
|
- $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]
|
|
- gsutil cp $$fname gs://grafana-downloads-test/enterprise/release/
|
|
- gsutil cp "$$fname.sha256" gs://grafana-downloads-test/enterprise/release/
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/ci-wix:0.1.1
|
|
name: build-windows-installer
|
|
trigger:
|
|
event:
|
|
- custom
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-test-release
|
|
- oss-windows-test-release
|
|
- enterprise-build-test-release
|
|
- enterprise-windows-test-release
|
|
kind: pipeline
|
|
name: publish-test-release
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
- ./bin/grabpl verify-version v7.3.0-test
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
|
|
- ./bin/grabpl publish-packages --edition oss --gcp-key /tmp/gcpkey.json --deb-db-bucket
|
|
grafana-testing-aptly-db --deb-repo-bucket grafana-testing-repo --packages-bucket
|
|
grafana-downloads-test --rpm-repo-bucket grafana-testing-repo --simulate-release
|
|
v7.3.0-test
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_COM_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-packages-oss
|
|
- commands:
|
|
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
|
|
- ./bin/grabpl publish-packages --edition enterprise --gcp-key /tmp/gcpkey.json
|
|
--deb-db-bucket grafana-testing-aptly-db --deb-repo-bucket grafana-testing-repo
|
|
--packages-bucket grafana-downloads-test --rpm-repo-bucket grafana-testing-repo
|
|
--simulate-release v7.3.0-test
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_COM_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: publish-packages-enterprise
|
|
trigger:
|
|
event:
|
|
- custom
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-test-release
|
|
- oss-windows-test-release
|
|
- enterprise-build-test-release
|
|
- enterprise-windows-test-release
|
|
- publish-test-release
|
|
kind: pipeline
|
|
name: notify-test-release
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
steps:
|
|
- image: plugins/slack
|
|
name: slack
|
|
settings:
|
|
channel: grafana-ci-notifications
|
|
template: |-
|
|
Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}
|
|
Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>
|
|
Author: {{build.author}}
|
|
webhook:
|
|
from_secret: slack_webhook
|
|
trigger:
|
|
event:
|
|
- custom
|
|
status:
|
|
- failure
|
|
type: docker
|
|
---
|
|
depends_on: []
|
|
kind: pipeline
|
|
name: oss-build-release-branch
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- make gen-go
|
|
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
|
|
- yarn install --immutable
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition oss
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition oss
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER}
|
|
--no-pull-enterprise
|
|
depends_on:
|
|
- test-backend
|
|
environment: {}
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id
|
|
${DRONE_BUILD_NUMBER} --no-pull-enterprise
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin
|
|
depends_on:
|
|
- lint-backend
|
|
environment:
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise
|
|
--sign
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PORT: 3001
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
dry_run: true
|
|
edition: oss
|
|
ubuntu: false
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images-ubuntu
|
|
settings:
|
|
dry_run: true
|
|
edition: oss
|
|
ubuntu: true
|
|
- commands:
|
|
- yarn storybook:build
|
|
- ./bin/grabpl verify-storybook
|
|
depends_on:
|
|
- build-frontend
|
|
environment:
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
image: grafana/build-container:1.4.5
|
|
name: build-storybook
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition oss --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition oss --packages-bucket grafana-downloads
|
|
depends_on:
|
|
- end-to-end-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages
|
|
trigger:
|
|
ref:
|
|
- refs/heads/v[0-9]*
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-release-branch
|
|
kind: pipeline
|
|
name: oss-windows-release-branch
|
|
platform:
|
|
arch: amd64
|
|
os: windows
|
|
version: "1809"
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- echo $env:DRONE_RUNNER_NAME
|
|
image: mcr.microsoft.com/windows:1809
|
|
name: identify-runner
|
|
- commands:
|
|
- $$ProgressPreference = "SilentlyContinue"
|
|
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/windows/grabpl.exe
|
|
-OutFile grabpl.exe
|
|
image: grafana/ci-wix:0.1.1
|
|
name: initialize
|
|
- commands:
|
|
- $$gcpKey = $$env:GCP_KEY
|
|
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
|
> gcpkey.json'
|
|
- dos2unix gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=gcpkey.json
|
|
- rm gcpkey.json
|
|
- cp C:\App\nssm-2.24.zip .
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/ci-wix:0.1.1
|
|
name: build-windows-installer
|
|
trigger:
|
|
ref:
|
|
- refs/heads/v[0-9]*
|
|
type: docker
|
|
---
|
|
clone:
|
|
disable: true
|
|
depends_on: []
|
|
image_pull_secrets:
|
|
- dockerconfigjson
|
|
kind: pipeline
|
|
name: enterprise-build-release-branch
|
|
node:
|
|
type: no-parallel
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services:
|
|
- environment:
|
|
POSTGRES_DB: grafanatest
|
|
POSTGRES_PASSWORD: grafanatest
|
|
POSTGRES_USER: grafanatest
|
|
image: postgres:12.3-alpine
|
|
name: postgres
|
|
- environment:
|
|
MYSQL_DATABASE: grafana_tests
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: rootpass
|
|
MYSQL_USER: grafana
|
|
image: mysql:5.6.48
|
|
name: mysql
|
|
- environment: {}
|
|
image: redis:6.2.1-alpine
|
|
name: redis
|
|
- environment: {}
|
|
image: memcached:1.6.9-alpine
|
|
name: memcached
|
|
steps:
|
|
- commands:
|
|
- mkdir -p bin
|
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/grabpl
|
|
- chmod +x bin/grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: grabpl
|
|
- commands:
|
|
- echo $DRONE_RUNNER_NAME
|
|
image: alpine:3.14.2
|
|
name: identify-runner
|
|
- commands:
|
|
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
|
|
- cd grafana-enterprise
|
|
- git checkout ${DRONE_BRANCH}
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/build-container:1.4.5
|
|
name: clone
|
|
- commands:
|
|
- mv bin/grabpl /tmp/
|
|
- rmdir bin
|
|
- mv grafana-enterprise /tmp/
|
|
- /tmp/grabpl init-enterprise /tmp/grafana-enterprise
|
|
- mv /tmp/grafana-enterprise/deployment_tools_config.json deployment_tools_config.json
|
|
- mkdir bin
|
|
- mv /tmp/grabpl bin/
|
|
- make gen-go
|
|
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
|
|
- yarn install --immutable
|
|
depends_on:
|
|
- grabpl
|
|
image: grafana/build-container:1.4.5
|
|
name: initialize
|
|
- commands:
|
|
- ./bin/grabpl verify-drone
|
|
depends_on:
|
|
- grabpl
|
|
image: byrnedo/alpine-curl:0.1.8
|
|
name: lint-drone
|
|
- commands:
|
|
- |-
|
|
echo -e "unknwon
|
|
referer
|
|
errorstring
|
|
eror
|
|
iam
|
|
wan" > words_to_ignore.txt
|
|
- codespell -I words_to_ignore.txt docs/
|
|
- rm words_to_ignore.txt
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: codespell
|
|
- commands:
|
|
- ./bin/grabpl shellcheck
|
|
depends_on:
|
|
- initialize
|
|
image: grafana/build-container:1.4.5
|
|
name: shellcheck
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition enterprise
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend
|
|
- commands:
|
|
- yarn run prettier:check
|
|
- yarn run lint
|
|
- yarn run typecheck
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-frontend
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition enterprise
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition enterprise
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration
|
|
- commands:
|
|
- yarn run ci:test-frontend
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
TEST_MAX_WORKERS: 50%
|
|
image: grafana/build-container:1.4.5
|
|
name: test-frontend
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq postgresql-client
|
|
- dockerize -wait tcp://postgres:5432 -timeout 120s
|
|
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database postgres
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: postgres
|
|
PGPASSWORD: grafanatest
|
|
POSTGRES_HOST: postgres
|
|
image: grafana/build-container:1.4.5
|
|
name: postgres-integration-tests
|
|
- commands:
|
|
- apt-get update
|
|
- apt-get install -yq default-mysql-client
|
|
- dockerize -wait tcp://mysql:3306 -timeout 120s
|
|
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
|
|
-prootpass
|
|
- go clean -testcache
|
|
- ./bin/grabpl integration-tests --database mysql
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GRAFANA_TEST_DB: mysql
|
|
MYSQL_HOST: mysql
|
|
image: grafana/build-container:1.4.5
|
|
name: mysql-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition enterprise --build-id ${DRONE_BUILD_NUMBER}
|
|
--no-pull-enterprise
|
|
depends_on:
|
|
- test-backend
|
|
environment: {}
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend
|
|
- commands:
|
|
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition enterprise --build-id
|
|
${DRONE_BUILD_NUMBER} --no-pull-enterprise
|
|
depends_on:
|
|
- test-frontend
|
|
image: grafana/build-container:1.4.5
|
|
name: build-frontend
|
|
- commands:
|
|
- ./bin/grabpl build-plugins --jobs 8 --edition enterprise --no-install-deps --sign
|
|
--signing-admin
|
|
depends_on:
|
|
- lint-backend
|
|
environment:
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: build-plugins
|
|
- commands:
|
|
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
|
|
depends_on:
|
|
- build-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: validate-scuemata
|
|
- commands:
|
|
- '# Make sure the git tree is clean.'
|
|
- '# Stashing changes, since packages that were produced in build-backend step are
|
|
needed.'
|
|
- git stash
|
|
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
|
|
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
|
|
.cue files.'
|
|
- '# It is required that the generated Typescript be in sync with the input CUE
|
|
files.'
|
|
- '# ...Modulo eslint auto-fixes...:'
|
|
- yarn run eslint . --ext .gen.ts --fix
|
|
- '# If any filenames are emitted by the below script, run the generator command
|
|
`grafana-cli cue gen-ts` locally and commit the result.'
|
|
- ./scripts/clean-git-or-error.sh
|
|
- '# Un-stash changes.'
|
|
- git stash pop
|
|
depends_on:
|
|
- validate-scuemata
|
|
image: grafana/build-container:1.4.5
|
|
name: ensure-cuetsified
|
|
- commands:
|
|
- ./bin/grabpl lint-backend --edition enterprise2
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
image: grafana/build-container:1.4.5
|
|
name: lint-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl test-backend --edition enterprise2
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl integration-tests --edition enterprise2
|
|
depends_on:
|
|
- lint-backend
|
|
image: grafana/build-container:1.4.5
|
|
name: test-backend-integration-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl build-backend --jobs 8 --edition enterprise2 --build-id ${DRONE_BUILD_NUMBER}
|
|
--variants linux-x64 --no-pull-enterprise
|
|
depends_on:
|
|
- test-backend-enterprise2
|
|
environment: {}
|
|
image: grafana/build-container:1.4.5
|
|
name: build-backend-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition enterprise --build-id ${DRONE_BUILD_NUMBER}
|
|
--no-pull-enterprise --sign
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
- build-backend-enterprise2
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package
|
|
detach: true
|
|
environment:
|
|
PACKAGE_FILE: dist/grafana-enterprise-*linux-amd64.tar.gz
|
|
PORT: 3001
|
|
RUNDIR: e2e/tmp-grafana-enterprise
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3001 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
HOST: end-to-end-tests-server
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests
|
|
- commands:
|
|
- ls dist/*.tar.gz*
|
|
- cp dist/*.tar.gz* packaging/docker/
|
|
depends_on:
|
|
- package
|
|
image: grafana/build-container:1.4.5
|
|
name: copy-packages-for-docker
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images
|
|
settings:
|
|
dry_run: true
|
|
edition: enterprise
|
|
ubuntu: false
|
|
- depends_on:
|
|
- copy-packages-for-docker
|
|
image: grafana/drone-grafana-docker:0.3.2
|
|
name: build-docker-images-ubuntu
|
|
settings:
|
|
dry_run: true
|
|
edition: enterprise
|
|
ubuntu: true
|
|
- commands:
|
|
- yarn storybook:build
|
|
- ./bin/grabpl verify-storybook
|
|
depends_on:
|
|
- build-frontend
|
|
environment:
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
|
image: grafana/build-container:1.4.5
|
|
name: build-storybook
|
|
- commands:
|
|
- dockerize -wait tcp://redis:6379/0 -timeout 120s
|
|
- ./bin/grabpl integration-tests
|
|
depends_on:
|
|
- test-backend
|
|
- test-frontend
|
|
environment:
|
|
REDIS_URL: redis://redis:6379/0
|
|
image: grafana/build-container:1.4.5
|
|
name: redis-integration-tests
|
|
- commands:
|
|
- dockerize -wait tcp://memcached:11211 -timeout 120s
|
|
- ./bin/grabpl integration-tests
|
|
depends_on:
|
|
- test-backend
|
|
- test-frontend
|
|
environment:
|
|
MEMCACHED_HOSTS: memcached:11211
|
|
image: grafana/build-container:1.4.5
|
|
name: memcached-integration-tests
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition enterprise --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition enterprise --packages-bucket grafana-downloads
|
|
depends_on:
|
|
- end-to-end-tests
|
|
- redis-integration-tests
|
|
- memcached-integration-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages
|
|
- commands:
|
|
- ./bin/grabpl package --jobs 8 --edition enterprise2 --build-id ${DRONE_BUILD_NUMBER}
|
|
--no-pull-enterprise --variants linux-x64 --sign
|
|
depends_on:
|
|
- build-plugins
|
|
- build-backend
|
|
- build-frontend
|
|
- build-backend-enterprise2
|
|
- test-backend-enterprise2
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
GPG_KEY_PASSWORD:
|
|
from_secret: gpg_key_password
|
|
GPG_PRIV_KEY:
|
|
from_secret: gpg_priv_key
|
|
GPG_PUB_KEY:
|
|
from_secret: gpg_pub_key
|
|
GRAFANA_API_KEY:
|
|
from_secret: grafana_api_key
|
|
image: grafana/build-container:1.4.5
|
|
name: package-enterprise2
|
|
- commands:
|
|
- ./e2e/start-server
|
|
depends_on:
|
|
- package-enterprise2
|
|
detach: true
|
|
environment:
|
|
PACKAGE_FILE: dist/grafana-enterprise2-*linux-amd64.tar.gz
|
|
PORT: 3002
|
|
RUNDIR: e2e/tmp-grafana-enterprise2
|
|
image: grafana/build-container:1.4.5
|
|
name: end-to-end-tests-server-enterprise2
|
|
- commands:
|
|
- yarn run cypress install
|
|
- ./bin/grabpl e2e-tests --port 3002 --tries 3
|
|
depends_on:
|
|
- end-to-end-tests-server-enterprise2
|
|
environment:
|
|
HOST: end-to-end-tests-server-enterprise2
|
|
image: grafana/ci-e2e:12.19.0-1
|
|
name: end-to-end-tests-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl upload-cdn --edition enterprise2 --bucket "grafana-static-assets"
|
|
depends_on:
|
|
- end-to-end-tests-server-enterprise2
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-cdn-assets-enterprise2
|
|
- commands:
|
|
- ./bin/grabpl upload-packages --edition enterprise2 --packages-bucket grafana-downloads-enterprise2
|
|
depends_on:
|
|
- end-to-end-tests-enterprise2
|
|
- redis-integration-tests
|
|
- memcached-integration-tests
|
|
environment:
|
|
GCP_GRAFANA_UPLOAD_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/grafana-ci-deploy:1.3.1
|
|
name: upload-packages-enterprise2
|
|
trigger:
|
|
ref:
|
|
- refs/heads/v[0-9]*
|
|
type: docker
|
|
---
|
|
clone:
|
|
disable: true
|
|
depends_on:
|
|
- enterprise-build-release-branch
|
|
image_pull_secrets:
|
|
- dockerconfigjson
|
|
kind: pipeline
|
|
name: enterprise-windows-release-branch
|
|
platform:
|
|
arch: amd64
|
|
os: windows
|
|
version: "1809"
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- echo $env:DRONE_RUNNER_NAME
|
|
image: mcr.microsoft.com/windows:1809
|
|
name: identify-runner
|
|
- commands:
|
|
- $$ProgressPreference = "SilentlyContinue"
|
|
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.5.5/windows/grabpl.exe
|
|
-OutFile grabpl.exe
|
|
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
|
|
- cd grafana-enterprise
|
|
- git checkout $$env:DRONE_BRANCH
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
image: grafana/ci-wix:0.1.1
|
|
name: clone
|
|
- commands:
|
|
- cp -r grafana-enterprise C:\App\grafana-enterprise
|
|
- rm -r -force grafana-enterprise
|
|
- cp grabpl.exe C:\App\grabpl.exe
|
|
- rm -force grabpl.exe
|
|
- C:\App\grabpl.exe init-enterprise C:\App\grafana-enterprise
|
|
- cp C:\App\grabpl.exe grabpl.exe
|
|
depends_on:
|
|
- clone
|
|
image: grafana/ci-wix:0.1.1
|
|
name: initialize
|
|
- commands:
|
|
- $$gcpKey = $$env:GCP_KEY
|
|
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
|
> gcpkey.json'
|
|
- dos2unix gcpkey.json
|
|
- gcloud auth activate-service-account --key-file=gcpkey.json
|
|
- rm gcpkey.json
|
|
- cp C:\App\nssm-2.24.zip .
|
|
depends_on:
|
|
- initialize
|
|
environment:
|
|
GCP_KEY:
|
|
from_secret: gcp_key
|
|
image: grafana/ci-wix:0.1.1
|
|
name: build-windows-installer
|
|
trigger:
|
|
ref:
|
|
- refs/heads/v[0-9]*
|
|
type: docker
|
|
---
|
|
depends_on:
|
|
- oss-build-release-branch
|
|
- oss-windows-release-branch
|
|
- enterprise-build-release-branch
|
|
- enterprise-windows-release-branch
|
|
kind: pipeline
|
|
name: notify-release-branch
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
steps:
|
|
- image: plugins/slack
|
|
name: slack
|
|
settings:
|
|
channel: grafana-ci-notifications
|
|
template: |-
|
|
Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}
|
|
Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>
|
|
Author: {{build.author}}
|
|
webhook:
|
|
from_secret: slack_webhook
|
|
trigger:
|
|
ref:
|
|
- refs/heads/v[0-9]*
|
|
status:
|
|
- failure
|
|
type: docker
|
|
---
|
|
kind: pipeline
|
|
name: scan-docker-images
|
|
platform:
|
|
arch: amd64
|
|
os: linux
|
|
services: []
|
|
steps:
|
|
- commands:
|
|
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:latest
|
|
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:main
|
|
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:latest-ubuntu
|
|
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:main-ubuntu
|
|
image: aquasec/trivy:0.18.3
|
|
name: scan-docker-images-unkown-low-medium-vulnerabilities
|
|
- commands:
|
|
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:latest
|
|
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:main
|
|
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:latest-ubuntu
|
|
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:main-ubuntu
|
|
image: aquasec/trivy:0.18.3
|
|
name: scan-docker-images-high-critical-vulnerabilities
|
|
- image: plugins/slack
|
|
name: slack-notify-failure
|
|
settings:
|
|
channel: grafana-backend-ops
|
|
template: 'Nightly docker image scan job for {{repo.name}} failed: {{build.link}}'
|
|
webhook:
|
|
from_secret: slack_webhook_backend
|
|
when:
|
|
status: failure
|
|
trigger:
|
|
cron: nightly
|
|
event: cron
|
|
type: docker
|
|
---
|
|
get:
|
|
name: .dockerconfigjson
|
|
path: secret/data/common/gcr
|
|
kind: secret
|
|
name: dockerconfigjson
|
|
---
|
|
get:
|
|
name: pat
|
|
path: infra/data/ci/github/grafanabot
|
|
kind: secret
|
|
name: github_token
|
|
---
|
|
get:
|
|
name: machine-user-token
|
|
path: infra/data/ci/drone
|
|
kind: secret
|
|
name: drone_token
|
|
---
|
|
kind: signature
|
|
hmac: 434491b80be6d7ca03ed7ca8b9978794ac1bc9ee5037d42bcce9b245c1f76579
|
|
|
|
...
|