Skip to content

Commit

Permalink
update to recent API
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantxu committed Sep 30, 2019
1 parent 0bfe96b commit 364103b
Show file tree
Hide file tree
Showing 29 changed files with 6,583 additions and 2,938 deletions.
181 changes: 154 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,158 @@
version: 2
jobs:
build:
build_plugin:
docker:
# specify the version you desire here
- image: circleci/node:8

working_directory: ~/repo

- image: circleci/node:10
working_directory: ~/plugin
steps:
- checkout
- run:
name: install yarn
command: 'sudo npm install -g yarn --quiet'
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
- node_modules
# - run:
# name: test
# command: 'yarn test'
- run:
name: build
command: 'yarn build'
- store_artifacts:
path: dist
- 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
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
- package:
requires:
- build_plugin
- test_6_2_5:
requires:
- package
- test_6_3_0_beta1:
requires:
- package
- report:
requires:
- test_6_2_5
- test_6_3_0_beta1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018 Ryan McKinley
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
42 changes: 3 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,5 @@
## Grafana Streaming Datasource (WORK IN PROGRESS)
# Simple Data Source

[![CircleCI](https://circleci.com/gh/ryantxu/streaming-datasource/tree/master.svg?style=svg)](https://circleci.com/gh/ryantxu/streaming-datasource/tree/master)
[![dependencies Status](https://david-dm.org/ryantxu/streaming-datasource/status.svg)](https://david-dm.org/ryantxu/streaming-datasource)
[![devDependencies Status](https://david-dm.org/ryantxu/streaming-datasource/dev-status.svg)](https://david-dm.org/ryantxu/streaming-datasource?type=dev)
[![CircleCI](https://circleci.com/gh/grafana/simple-datasource/tree/master.svg?style=svg)](https://circleci.com/gh/grafana/simple-datasource/tree/master)

Simple streaming datasource. See also:
https://github.com/seanlaff/simple-streaming-datasource/


This currently does a javascript only random walk


### Example Server

To run the sample server run:
```
go run server.go
```


To see the output it produces, run:
```
curl --no-buffer http://localhost:7777
```


### Building

To complie, run:

```
yarn install --pure-lockfile
yarn build
```

#### Changelog

##### v0.0.1-dev

* First working version
This is a stub to show how to create a basic data source plugin.
31 changes: 0 additions & 31 deletions config.yml

This file was deleted.

5 changes: 0 additions & 5 deletions index.d.ts

This file was deleted.

28 changes: 0 additions & 28 deletions jest.config.js

This file was deleted.

57 changes: 12 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,20 @@
{
"name": "ryantxu-streaming-datasource",
"version": "0.0.1-dev",
"description": "Streaming Datasource",
"version": "0.0.1",
"description": "Example of a Grafana Data Source",
"scripts": {
"build": "webpack --config webpack.config.prod.js",
"dev": "webpack --mode development",
"watch": "webpack --mode development --watch",
"test": "jest --config jest.config.js",
"release": "node release.js",
"precommit": "pretty-quick --staged",
"pretty": "prettier --write src/**/*.ts"
"build": "grafana-toolkit plugin:build",
"test": "grafana-toolkit plugin:test",
"dev": "grafana-toolkit plugin:dev",
"watch": "grafana-toolkit plugin:dev --watch"
},
"author": "Ryan McKinley",
"license": "Apache",
"dependencies": {
"lodash": "^4.17.10",
"react": "^16.2.0",
"react-dom": "^16.2.0"
},
"prettier": {
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 120
},
"license": "Apache-2.0",
"devDependencies": {
"@types/grafana": "github:CorpGlory/types-grafana.git",
"@types/jest": "^23.3.1",
"@types/lodash": "^4.14.74",
"@types/react": "^16.2.0",
"babel-core": "^6.26.3",
"babel-jest": "^23.0.1",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"clean-webpack-plugin": "^0.1.19",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^1.0.0",
"grafana-sdk-mocks": "github:ryantxu/grafana-sdk-mocks",
"jest": "^23.0.1",
"ng-annotate-webpack-plugin": "^0.3.0",
"prettier": "^1.14",
"pretty-quick": "^1.4.1",
"replace-in-file-webpack-plugin": "^1.0.6",
"rxjs": "^6.3.3",
"style-loader": "^0.22",
"ts-jest": "^23",
"ts-loader": "^4.3.0",
"typescript": "^3",
"webpack": "^4.17",
"webpack-cli": "^3.1",
"uglifyjs-webpack-plugin": "^2.1.1"
"@grafana/data": "next",
"@grafana/toolkit": "next",
"@grafana/ui": "next",
"@types/lodash": "^4.14.134",
"lodash": "^4.17.15"
}
}
Loading

0 comments on commit 364103b

Please sign in to comment.