Revision c3cf4478c928637e1f48e5afafb73fd5ddb560f3 authored by dsotirakis on 17 September 2021, 16:59:44 UTC, committed by dsotirakis on 17 September 2021, 16:59:44 UTC
1 parent 41b9e3c
Raw File
.drone.yml
---
kind: pipeline
type: docker
name: test-pr

platform:
  os: linux
  arch: amd64

steps:
- name: identify-runner
  image: alpine:3.14.2
  commands:
  - echo $DRONE_RUNNER_NAME

- name: initialize
  image: grafana/build-container:1.4.2
  commands:
  - echo test
  - mkdir -p bin
  - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl
  - chmod +x bin/grabpl
  - yarn cache dir
  - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz
  - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz
  - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz
  - yarn install --frozen-lockfile --no-progress
  environment:
    DOCKERIZE_VERSION: 0.6.1
    YARN_CACHE_FOLDER: /cache/yarn
  volumes:
  - name: cache
    path: /cache
  depends_on:
  - clone

- name: codespell
  image: grafana/build-container:1.4.2
  commands:
  - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt"
  - codespell -I words_to_ignore.txt docs/
  depends_on:
  - initialize

- name: shellcheck
  image: grafana/build-container:1.4.2
  commands:
  - ./bin/grabpl shellcheck
  depends_on:
  - initialize

- name: restore-cache
  pull: always
  image: jduchesnegrafana/drone-cache:v1.2.0-rc0-dirtytest
  settings:
    backend: gcs
    bucket: test-julien
    cache_key: test123
    json_key:
      from_secret: tf_google_credentials
    local_root: /cache
    mount:
    - yarn
    restore: true
  volumes:
  - name: cache
    path: /cache
  depends_on:
  - clone

- name: lint-backend
  image: grafana/build-container:1.4.2
  commands:
  - make gen-go
  - ./bin/grabpl lint-backend --edition oss
  environment:
    CGO_ENABLED: 1

- name: test-frontend
  image: grafana/build-container:1.4.2
  commands:
  - yarn run ci:test-frontend
  environment:
    TEST_MAX_WORKERS: 50%
    YARN_CACHE_FOLDER: /cache/yarn
  depends_on:
  - restore-cache
  - initialize

- name: build-frontend
  image: grafana/build-container:1.4.2
  commands:
  - ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise
  environment:
    YARN_CACHE_FOLDER: /cache/yarn
  depends_on:
  - test-frontend

- name: rebuild-cache
  pull: always
  image: jduchesnegrafana/drone-cache:v1.2.0-rc0-dirtytest
  settings:
    backend: gcs
    bucket: test-julien
    cache_key: test123
    json_key:
      from_secret: tf_google_credentials
    local_root: /cache
    mount:
    - yarn
    rebuild: true
  volumes:
  - name: cache
    path: /cache
  when:
    event:
    - pull_request
  depends_on:
  - initialize

volumes:
- name: cache
  temp: {}

trigger:
  event:
  - pull_request

---
kind: secret
name: dockerconfigjson

get:
  path: secret/data/common/gcr
  name: .dockerconfigjson

---
kind: secret
name: github_token

get:
  path: infra/data/ci/github/grafanabot
  name: pat

---
kind: secret
name: drone_token

get:
  path: infra/data/ci/drone
  name: machine-user-token

---
kind: secret
name: tf_google_credentials

get:
  path: infra/data/ci/terraform/google
  name: credentials.json

---
kind: secret
name: access_key

get:
  path: infra/data/ci/test-drone-caching
  name: access-key

---
kind: secret
name: secret

get:
  path: infra/data/ci/test-drone-caching
  name: secret

---
kind: signature
hmac: 0f75ff7999f74b8ee0717fad8faad40304444b505b2558f83f5c7e3219c3babe

...
back to top