Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 45ec6c3

Browse files
authored
Merge pull request #265 from grafana/v1.0.x
Chore: V1.0.x -> merge back to master and rebranch
2 parents c776ba4 + 06b3674 commit 45ec6c3

File tree

6 files changed

+9477
-176
lines changed

6 files changed

+9477
-176
lines changed

.circleci/config.yml

Lines changed: 154 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,155 @@
1-
version: 2 # use CircleCI 2.0
1+
version: 2.1
22

3-
jobs: # a collection of steps
4-
build: # runs not using Workflows must have a `build` job as entry point
5-
working_directory: ~/worldmap-panel # directory where steps will run
6-
docker: # run the steps with Docker
7-
- image: circleci/node:latest
8-
steps:
9-
- checkout
10-
- restore_cache:
11-
name: Restore Yarn Package Cache
12-
keys:
13-
- yarn-packages-{{ checksum "yarn.lock" }}
14-
- run:
15-
name: Install Dependencies
16-
command: yarn install --frozen-lockfile
17-
- save_cache:
18-
name: Save Yarn Package Cache
19-
key: yarn-packages-{{ checksum "yarn.lock" }}
20-
paths:
21-
- ~/.cache/yarn
22-
- run: # run tests
23-
name: test
24-
command: yarn test
3+
parameters:
4+
ssh-fingerprint:
5+
type: string
6+
default: ${GITHUB_SSH_FINGERPRINT}
7+
8+
aliases:
9+
# Workflow filters
10+
- &filter-only-master
11+
branches:
12+
only: master
13+
- &filter-only-release
14+
branches:
15+
only: /^v[1-9]*[0-9]+\.[1-9]*[0-9]+\.x$/
16+
17+
workflows:
18+
plugin_workflow:
19+
jobs:
20+
- build
21+
- report:
22+
requires:
23+
- build
24+
- approve_release:
25+
type: approval
26+
requires:
27+
- report
28+
filters: *filter-only-release
29+
- publish_github_release:
30+
requires:
31+
- approve_release
32+
filters: *filter-only-release
33+
34+
executors:
35+
default_exec: # declares a reusable executor
36+
docker:
37+
- image: srclosson/grafana-plugin-ci-alpine:latest
38+
e2e_exec:
39+
docker:
40+
- image: srclosson/grafana-plugin-ci-e2e:latest
41+
42+
jobs:
43+
build:
44+
executor: default_exec
45+
steps:
46+
- checkout
47+
- restore_cache:
48+
name: restore node_modules
49+
keys:
50+
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
51+
- run:
52+
name: Install dependencies
53+
command: |
54+
mkdir ci
55+
[ -f ~/project/node_modules/.bin/grafana-toolkit ] || yarn install --frozen-lockfile
56+
- save_cache:
57+
name: save node_modules
58+
paths:
59+
- ~/project/node_modules
60+
key: build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
61+
- save_cache:
62+
name: save cypress cache
63+
paths:
64+
- ~/.cache/Cypress
65+
key: cypress-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
66+
- run:
67+
name: Build and test panel
68+
command: |
69+
sed -e "s/%VERSION%/$(cat package.json | jq .version | tr -d '\"')/" -e "s/%TODAY%/$(date)/" ./src/plugin.json.tmpl > ./src/plugin.json
70+
yarn build
71+
- run:
72+
name: Move results to ci folder
73+
command: |
74+
# Update the plugin.json with up to date info
75+
mkdir -pv ci/job/build_plugin
76+
mkdir -pv ci/packages
77+
mkdir -pv ci/jobs/package
78+
mkdir -pv ci/grafana-test-env
79+
cp -rv dist ci/job/build_plugin
80+
- run:
81+
name: Package distribution
82+
command: |
83+
./node_modules/.bin/grafana-toolkit plugin:ci-package
84+
- persist_to_workspace:
85+
root: .
86+
paths:
87+
- ci/jobs/package
88+
- ci/packages
89+
- ci/dist
90+
- ci/grafana-test-env
91+
- store_artifacts:
92+
path: ci
93+
94+
report:
95+
executor: default_exec
96+
steps:
97+
- checkout
98+
- attach_workspace:
99+
at: .
100+
- restore_cache:
101+
name: restore node_modules
102+
keys:
103+
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
104+
- run:
105+
name: Toolkit report
106+
command: |
107+
./node_modules/.bin/grafana-toolkit plugin:ci-report
108+
- store_artifacts:
109+
path: ci
110+
111+
publish_github_release:
112+
executor: default_exec
113+
steps:
114+
- checkout
115+
- add_ssh_keys:
116+
fingerprints:
117+
- "${GITHUB_SSH_FINGERPRINT}"
118+
- attach_workspace:
119+
at: .
120+
- restore_cache:
121+
name: restore node_modules
122+
keys:
123+
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
124+
- run:
125+
name: "Publish Release on GitHub"
126+
command: |
127+
wget "https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz"
128+
tar zxvf "./ghr_v0.13.0_linux_amd64.tar.gz" -C /usr/local
129+
/bin/rm -rf "./ghr_v0.13.0_linux_amd64.tar.gz"
130+
mkdir -pv dist
131+
mkdir -pv artifacts
132+
cp -r ci/dist/grafana-worldmap-panel/* dist/
133+
cp -r ci/packages/* artifacts/
134+
DATASOURCE_NAME=grafana-worldmap-panel
135+
RELEASE_NOTES=`awk 'BEGIN {FS="##"; RS=""} FNR==4 {print; exit}' CHANGELOG.md`
136+
VERSION=`cat ci/dist/plugin.json|jq '.info.version'| sed s/\"//g`
137+
git config user.email "[email protected]"
138+
git config user.name "CircleCI Automation"
139+
git checkout -b release-${VERSION}
140+
git add --force dist/
141+
git add --force artifacts/
142+
git commit -m "automated release $VERSION [skip ci]"
143+
git push -f origin release-${VERSION}
144+
git tag -f v${VERSION}
145+
git push -f origin v${VERSION}
146+
/usr/local/ghr_v0.13.0_linux_amd64/ghr \
147+
-t ${GITHUB_TOKEN} \
148+
-u ${CIRCLE_PROJECT_USERNAME} \
149+
-r ${CIRCLE_PROJECT_REPONAME} \
150+
-c ${CIRCLE_SHA1} \
151+
-n "${DATASOURCE_NAME} v${VERSION}" \
152+
-b "${RELEASE_NOTES}" \
153+
-delete \
154+
v${VERSION} \
155+
./artifacts

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Changelog
2+
## Entries
3+
4+
## v1.0.1
5+
6+
- Release for Grafana 7.0 with plugin signing
27

38
## v0.2.1
49

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "worldmap-panel",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Worldmap Panel Plugin for Grafana",
55
"main": "src/module.js",
66
"scripts": {
@@ -20,6 +20,7 @@
2020
"devDependencies": {
2121
"@babel/core": "^7.1.6",
2222
"@babel/preset-env": "^7.1.6",
23+
"@grafana/toolkit": "next",
2324
"@types/grafana": "https://[email protected]/CorpGlory/types-grafana.git",
2425
"@types/jest": "^23.3.9",
2526
"@types/lodash": "^4.14.118",
@@ -45,6 +46,7 @@
4546
"webpack-cli": "^3.1.2"
4647
},
4748
"dependencies": {
48-
"lodash": "^4.17.11"
49+
"lodash": "^4.17.11",
50+
"package.json": "^2.0.1"
4951
}
5052
}

src/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
{"name": "USA", "path": "images/worldmap-usa.png"},
2424
{"name": "Light Theme", "path": "images/worldmap-light-theme.png"}
2525
],
26-
"version": "0.2.1",
27-
"updated": "2019-08-29"
26+
"version": "1.0.1",
27+
"updated": "Fri May 15 14:40:24 MDT 2020"
2828
},
2929

3030
"dependencies": {

src/plugin.json.tmpl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"type": "panel",
3+
"name": "Worldmap Panel",
4+
"id": "grafana-worldmap-panel",
5+
6+
"info": {
7+
"description": "World Map panel for Grafana. Displays time series data or geohash data from Elasticsearch overlaid on a world map.",
8+
"author": {
9+
"name": "Grafana Labs",
10+
"url": "https://grafana.com"
11+
},
12+
"keywords": ["worldmap", "panel"],
13+
"logos": {
14+
"small": "images/worldmap_logo.svg",
15+
"large": "images/worldmap_logo.svg"
16+
},
17+
"links": [
18+
{"name": "Project site", "url": "https://github.com/grafana/worldmap-panel"},
19+
{"name": "MIT License", "url": "https://github.com/grafana/worldmap-panel/blob/master/LICENSE"}
20+
],
21+
"screenshots": [
22+
{"name": "World", "path": "images/worldmap-world.png"},
23+
{"name": "USA", "path": "images/worldmap-usa.png"},
24+
{"name": "Light Theme", "path": "images/worldmap-light-theme.png"}
25+
],
26+
"version": "%VERSION%",
27+
"updated": "%TODAY%"
28+
},
29+
30+
"dependencies": {
31+
"grafanaVersion": "3.x.x",
32+
"plugins": [ ]
33+
}
34+
}

0 commit comments

Comments
 (0)