Skip to content

Commit

Permalink
implements plugin sign process during release.sh, fix Altinity#212
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Klimov <[email protected]>
  • Loading branch information
Slach committed Nov 24, 2020
1 parent d8645c2 commit 9d1dc1e
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ yarn.lock
package-lock.json
.cache
.release_env
ubuntu*.log
ubuntu*.log
9 changes: 9 additions & 0 deletions .release_env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set +x
export GITHUB_LOGIN="Your Name"
export GITHUB_EMAIL="your@email"
# create token in https://github.com/settings/tokens
export GITHUB_TOKEN="XXX"
# you should ask github @hagen1778 or @Slach how to invite you to Vertamedia grafana organization https://grafana.com/orgs/vertamedia
export GRAFANA_API_KEY=XXXX
set -xeuo pipefail
38 changes: 38 additions & 0 deletions dist/MANIFEST.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

{
"manifestVersion": "2.0.0",
"signatureType": "community",
"signedByOrg": "vertamedia",
"signedByOrgName": "Vertamedia",
"plugin": "vertamedia-clickhouse-datasource",
"version": "2.1.0",
"time": 1606213135619,
"keyId": "7e4d0c6a708866e7",
"files": {
"img/clickhouse_logo.svg": "111c2048c9bad4a11b0273cf17839696d98968c04cdcc5ea0716bdc973f2e8e4",
"LICENSE": "a434fc6dd97d5c425c6edbeff0276afd60ab5fffab3ed2c563f95a389502d074",
"module.js": "b18cabbba610e636a4473ab7e32e43296693ef527fb55e321c0d289048448c1f",
"module.js.map": "84992744df18b83ddb5eadd356fb12478ee864d4a99eb6bd90d4dda81feaac9b",
"partials/annotations.editor.html": "25f812caffd81d8f84a3fda912f10b7e113a7bb52f768a40e40c2f7b24025947",
"partials/config.html": "51ba130304c63c1a00590a9dc94c8351ff6277e4cf695720de57bff87aeec744",
"partials/query.editor.html": "eb9ab7af412a922ea2ce09c86b99a75ba70000977a5fd882b8e327a2a27e1904",
"plugin.json": "06ddb778e65aff439b66aabd08ea2ea0c9ceb9590c61150f44ddf315f99aac4c",
"README.md": "66fa3d8989c40ae77f26e8c8ee5855abf97a3b2858868001f076d00742bc4563",
"vertamedia-clickhouse-plugin_darwin_amd64": "131b1658600156ac92b96a5b2a92722a273bf3aa9cb24bad96b48c08a0a04abb",
"vertamedia-clickhouse-plugin_linux_amd64": "2ca859e9ea14a78771bb8791461c3dfc8be3ae79bd3a4ef9278464ec9c6c64e5",
"vertamedia-clickhouse-plugin_windows_amd64.exe": "f2235bc3bfd2041b01ea88aa494e497ddb60872422f11bebe01d4159e0ab607e"
}
}
-----BEGIN PGP SIGNATURE-----
Version: OpenPGP.js v4.10.1
Comment: https://openpgpjs.org

wqIEARMKAAYFAl+83g8ACgkQfk0ManCIZuf3awIJAV6gtREB9OiBnKU5Kap7
3pAcubH9x/KYcRSKfVi9TsgBUsPnux5aaB0/qqgo52qRwdzMpBWcRmYzeBmB
Pa1Ponh7AgkBquqGvz++r0qqTB1jgiwCXlAOtLBEECU0Hy0HWhj8RLG3ADL7
GcSIZOdS0EQn7WwiyGY/CMS2WmzRd+WP8sb2R9A=
=VU3F
-----END PGP SIGNATURE-----
23 changes: 19 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ services:
volumes:
- ./:/grafana-clickhouse
# for speedup npm install
- /grafana-clickhouse/node_modules
- "node_modules:/grafana-clickhouse/node_modules"
command: |
bash -xec "
npm install --production=false && \
bash -xec '
if [[ "3" == `ls -la ./node_modules/ | wc -l` ]]; then npm install --production=false; fi && \
npm run build:prod && \
npm run test:docker
"
'
backend_builder:
image: golang:1.15
Expand All @@ -85,4 +85,19 @@ services:
chmod +x ./dist/vertamedia-clickhouse-plugin*
"
plugin_signer:
image: node:lts
working_dir: /grafana-clickhouse
volumes:
- ./:/grafana-clickhouse
# for speedup npm install
- "node_modules:/grafana-clickhouse/node_modules"
command: |
bash -xec "
if [[ ! -f ./node_modules/@grafana/toolkit/bin/grafana-toolkit.js ]]; then npm install --production=false; fi && \
source /grafana-clickhouse/.release_env && \
node ./node_modules/@grafana/toolkit/bin/grafana-toolkit.js plugin:sign
"
volumes:
node_modules:
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"test:coverage": "jest --coverage --config jest.config.js",
"test:watch": "jest --config jest.config.js --watch",
"test:docker": "jest --ci --config jest.config.js",
"test:docker:watch": "jest --ci --config jest.config.js --watch"
"test:docker:watch": "jest --ci --config jest.config.js --watch",
"sign": "bash -xec \"source ./.release_env && node ./node_modules/@grafana/toolkit/bin/grafana-toolkit.js plugin:sign\""
},
"author": "Vertamedia",
"license": "MIT",
Expand All @@ -23,6 +24,7 @@
"systemjs": "^2.1.1"
},
"devDependencies": {
"@grafana/toolkit": "^7.4.0-pre-ryan.1",
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/preset-typescript": "^7.9.0",
Expand Down
3 changes: 3 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ dos2unix ./dist/*
git add .
git commit -m "prepare to new release, $(grep current_version .bumpversion.cfg)"
bump2version --verbose $1
docker-compose run plugin_signer
git add .
git commit -s -m "sign plugin, $(grep current_version .bumpversion.cfg)"
git push
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
}
],
plugins: [
new CleanWebpackPlugin('dist', { exclude: ['vertamedia-clickhouse-plugin_linux_amd64','vertamedia-clickhouse-plugin_darwin_amd64','vertamedia-clickhouse-plugin_windows_amd64.exe']}),
new CleanWebpackPlugin('dist', { exclude: ['MANIFEST.txt','vertamedia-clickhouse-plugin_linux_amd64','vertamedia-clickhouse-plugin_darwin_amd64','vertamedia-clickhouse-plugin_windows_amd64.exe']}),
new webpack.optimize.OccurrenceOrderPlugin(),
new CopyWebpackPlugin([
{from: 'plugin.json', to: '.'},
Expand Down

0 comments on commit 9d1dc1e

Please sign in to comment.