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

Commit

Permalink
Merge pull request #265 from grafana/v1.0.x
Browse files Browse the repository at this point in the history
Chore: V1.0.x -> merge back to master and rebranch
  • Loading branch information
srclosson authored May 15, 2020
2 parents c776ba4 + 06b3674 commit 45ec6c3
Show file tree
Hide file tree
Showing 6 changed files with 9,477 additions and 176 deletions.
177 changes: 154 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,155 @@
version: 2 # use CircleCI 2.0
version: 2.1

jobs: # a collection of steps
build: # runs not using Workflows must have a `build` job as entry point
working_directory: ~/worldmap-panel # directory where steps will run
docker: # run the steps with Docker
- image: circleci/node:latest
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run: # run tests
name: test
command: yarn test
parameters:
ssh-fingerprint:
type: string
default: ${GITHUB_SSH_FINGERPRINT}

aliases:
# Workflow filters
- &filter-only-master
branches:
only: master
- &filter-only-release
branches:
only: /^v[1-9]*[0-9]+\.[1-9]*[0-9]+\.x$/

workflows:
plugin_workflow:
jobs:
- build
- report:
requires:
- build
- approve_release:
type: approval
requires:
- report
filters: *filter-only-release
- publish_github_release:
requires:
- approve_release
filters: *filter-only-release

executors:
default_exec: # declares a reusable executor
docker:
- image: srclosson/grafana-plugin-ci-alpine:latest
e2e_exec:
docker:
- image: srclosson/grafana-plugin-ci-e2e:latest

jobs:
build:
executor: default_exec
steps:
- checkout
- restore_cache:
name: restore node_modules
keys:
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: Install dependencies
command: |
mkdir ci
[ -f ~/project/node_modules/.bin/grafana-toolkit ] || yarn install --frozen-lockfile
- save_cache:
name: save node_modules
paths:
- ~/project/node_modules
key: build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- save_cache:
name: save cypress cache
paths:
- ~/.cache/Cypress
key: cypress-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: Build and test panel
command: |
sed -e "s/%VERSION%/$(cat package.json | jq .version | tr -d '\"')/" -e "s/%TODAY%/$(date)/" ./src/plugin.json.tmpl > ./src/plugin.json
yarn build
- run:
name: Move results to ci folder
command: |
# Update the plugin.json with up to date info
mkdir -pv ci/job/build_plugin
mkdir -pv ci/packages
mkdir -pv ci/jobs/package
mkdir -pv ci/grafana-test-env
cp -rv dist ci/job/build_plugin
- run:
name: Package distribution
command: |
./node_modules/.bin/grafana-toolkit plugin:ci-package
- persist_to_workspace:
root: .
paths:
- ci/jobs/package
- ci/packages
- ci/dist
- ci/grafana-test-env
- store_artifacts:
path: ci

report:
executor: default_exec
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
name: restore node_modules
keys:
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: Toolkit report
command: |
./node_modules/.bin/grafana-toolkit plugin:ci-report
- store_artifacts:
path: ci

publish_github_release:
executor: default_exec
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "${GITHUB_SSH_FINGERPRINT}"
- attach_workspace:
at: .
- restore_cache:
name: restore node_modules
keys:
- build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- run:
name: "Publish Release on GitHub"
command: |
wget "https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz"
tar zxvf "./ghr_v0.13.0_linux_amd64.tar.gz" -C /usr/local
/bin/rm -rf "./ghr_v0.13.0_linux_amd64.tar.gz"
mkdir -pv dist
mkdir -pv artifacts
cp -r ci/dist/grafana-worldmap-panel/* dist/
cp -r ci/packages/* artifacts/
DATASOURCE_NAME=grafana-worldmap-panel
RELEASE_NOTES=`awk 'BEGIN {FS="##"; RS=""} FNR==4 {print; exit}' CHANGELOG.md`
VERSION=`cat ci/dist/plugin.json|jq '.info.version'| sed s/\"//g`
git config user.email "[email protected]"
git config user.name "CircleCI Automation"
git checkout -b release-${VERSION}
git add --force dist/
git add --force artifacts/
git commit -m "automated release $VERSION [skip ci]"
git push -f origin release-${VERSION}
git tag -f v${VERSION}
git push -f origin v${VERSION}
/usr/local/ghr_v0.13.0_linux_amd64/ghr \
-t ${GITHUB_TOKEN} \
-u ${CIRCLE_PROJECT_USERNAME} \
-r ${CIRCLE_PROJECT_REPONAME} \
-c ${CIRCLE_SHA1} \
-n "${DATASOURCE_NAME} v${VERSION}" \
-b "${RELEASE_NOTES}" \
-delete \
v${VERSION} \
./artifacts
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## Entries

## v1.0.1

- Release for Grafana 7.0 with plugin signing

## v0.2.1

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "worldmap-panel",
"version": "1.0.0",
"version": "1.0.1",
"description": "Worldmap Panel Plugin for Grafana",
"main": "src/module.js",
"scripts": {
Expand All @@ -20,6 +20,7 @@
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@grafana/toolkit": "next",
"@types/grafana": "https://[email protected]/CorpGlory/types-grafana.git",
"@types/jest": "^23.3.9",
"@types/lodash": "^4.14.118",
Expand All @@ -45,6 +46,7 @@
"webpack-cli": "^3.1.2"
},
"dependencies": {
"lodash": "^4.17.11"
"lodash": "^4.17.11",
"package.json": "^2.0.1"
}
}
4 changes: 2 additions & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
{"name": "USA", "path": "images/worldmap-usa.png"},
{"name": "Light Theme", "path": "images/worldmap-light-theme.png"}
],
"version": "0.2.1",
"updated": "2019-08-29"
"version": "1.0.1",
"updated": "Fri May 15 14:40:24 MDT 2020"
},

"dependencies": {
Expand Down
34 changes: 34 additions & 0 deletions src/plugin.json.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"type": "panel",
"name": "Worldmap Panel",
"id": "grafana-worldmap-panel",

"info": {
"description": "World Map panel for Grafana. Displays time series data or geohash data from Elasticsearch overlaid on a world map.",
"author": {
"name": "Grafana Labs",
"url": "https://grafana.com"
},
"keywords": ["worldmap", "panel"],
"logos": {
"small": "images/worldmap_logo.svg",
"large": "images/worldmap_logo.svg"
},
"links": [
{"name": "Project site", "url": "https://github.com/grafana/worldmap-panel"},
{"name": "MIT License", "url": "https://github.com/grafana/worldmap-panel/blob/master/LICENSE"}
],
"screenshots": [
{"name": "World", "path": "images/worldmap-world.png"},
{"name": "USA", "path": "images/worldmap-usa.png"},
{"name": "Light Theme", "path": "images/worldmap-light-theme.png"}
],
"version": "%VERSION%",
"updated": "%TODAY%"
},

"dependencies": {
"grafanaVersion": "3.x.x",
"plugins": [ ]
}
}
Loading

0 comments on commit 45ec6c3

Please sign in to comment.