Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Use @grafana/toolkit to manage build #69

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 240 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
version: 2
jobs:
build_plugin:
docker:
- image: circleci/node:10
working_directory: ~/plugin
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install yarn
command: |
sudo npm install -g yarn --quiet
yarn install --pure-lockfile
- run:
name: Run Toolkit Build
command: npx grafana-toolkit plugin:ci-build
- save_cache:
paths:
- node_modules
key: yarn-packages-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: .
paths:
- ci
build_docs:
docker:
- image: circleci/node:10
working_directory: ~/plugin
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install yarn
command: |
sudo npm install -g yarn --quiet
yarn install --pure-lockfile
mkdir ci # Avoid error if not exists
- run:
name: Build Docs
command: npx grafana-toolkit plugin:ci-docs
- save_cache:
paths:
- node_modules
key: yarn-packages-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: .
paths:
- ci
build_osx:
docker:
- image: circleci/node:10
working_directory: ~/plugin
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install yarn
command: |
sudo npm install -g yarn --quiet
yarn install --pure-lockfile
- run:
name: Run Toolkit CI
command: npx grafana-toolkit plugin:ci-build --backend osx
- save_cache:
paths:
- node_modules
key: yarn-packages-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: .
paths:
- ci/jobs/build_osx
build_win64:
docker:
- image: circleci/node:10
working_directory: ~/plugin
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install yarn
command: |
sudo npm install -g yarn --quiet
yarn install --pure-lockfile
- run:
name: Run Toolkit CI
command: npx grafana-toolkit plugin:ci-build --backend win64
- save_cache:
paths:
- node_modules
key: yarn-packages-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: .
paths:
- ci/jobs/build_win64
package:
docker:
- image: circleci/node:10
working_directory: ~/plugin
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Package Distribution
command: npx grafana-toolkit plugin:ci-package
- persist_to_workspace:
root: .
paths:
- ci/jobs/package
- ci/packages
- ci/dist
- ci/grafana-test-env
test_6_2_5:
docker:
- image: circleci/node:10-browsers
working_directory: ~/plugin
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Setup Grafana (local install)
command: |
wget https://dl.grafana.com/oss/release/grafana_6.2.5_amd64.deb
sudo apt-get install -y adduser libfontconfig1
sudo dpkg -i grafana_6.2.5_amd64.deb
sudo apt-get install locate
sudo updatedb
sudo locate grafana
sudo cat /etc/grafana/grafana.ini
sudo echo ------------------------
sudo cp ci/grafana-test-env/custom.ini /usr/share/grafana/conf/custom.ini
sudo cp ci/grafana-test-env/custom.ini /etc/grafana/grafana.ini
sudo service grafana-server start
sudo grafana-cli --version
- run:
name: Run e2e tests
command: |
npx grafana-toolkit plugin:ci-test
- persist_to_workspace:
root: .
paths:
- ci/jobs/test_6_2_5
- store_test_results:
path: ci/jobs/test_6_2_5
- store_artifacts:
path: ci/jobs/test_6_2_5
test_6_3_0_beta1:
docker:
- image: circleci/node:10-browsers
working_directory: ~/plugin
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Setup Grafana (local install)
command: |
wget https://dl.grafana.com/oss/release/grafana_6.3.0-beta1_amd64.deb
sudo apt-get install -y adduser libfontconfig1
sudo dpkg -i grafana_6.3.0-beta1_amd64.deb
sudo apt-get install locate
sudo updatedb
sudo locate grafana
sudo cat /etc/grafana/grafana.ini
sudo echo ------------------------
sudo cp ci/grafana-test-env/custom.ini /usr/share/grafana/conf/custom.ini
sudo cp ci/grafana-test-env/custom.ini /etc/grafana/grafana.ini
sudo service grafana-server start
sudo grafana-cli --version
- run:
name: Run e2e tests
command: |
npx grafana-toolkit plugin:ci-test
- persist_to_workspace:
root: .
paths:
- ci/jobs/test_6_3_0_beta1
- store_test_results:
path: ci/jobs/test_6_3_0_beta1
- store_artifacts:
path: ci/jobs/test_6_3_0_beta1
report:
docker:
- image: circleci/node:10
working_directory: ~/plugin
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Toolkit Report
command: npx grafana-toolkit plugin:ci-report
- store_artifacts:
path: ci
workflows:
version: 2
plugin_workflow:
jobs:
- build_plugin
- build_osx
- build_win64
- build_docs
- package:
requires:
- build_plugin
- build_osx
- build_win64
- build_docs
- test_6_2_5:
requires:
- package
- test_6_3_0_beta1:
requires:
- package
- report:
requires:
- test_6_2_5
- test_6_3_0_beta1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ jspm_packages
.node_repl_history

.tscache


dist/
4 changes: 4 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
...require("./node_modules/@grafana/toolkit/src/config/prettier.plugin.config.json"),
};

95 changes: 0 additions & 95 deletions Gruntfile.js

This file was deleted.

Loading