forked from doitintl/bigquery-grafana
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 2.0.0 with grafana dependency 10.4.0+ (#311)
* Release 2.0.0 with grafana dependency 10.4.0+ * Migrate from toolkit to plugin tools and update dependencies * Fix spellcheck * Fix spellcheck * Update CHANGELOG.md * Update docker-compose.yaml Co-authored-by: Sriram <153843+yesoreyeram@users.noreply.github.com> --------- Co-authored-by: Sriram <153843+yesoreyeram@users.noreply.github.com>
- Loading branch information
1 parent
f577257
commit 196e512
Showing
22 changed files
with
1,508 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"version": "4.2.0" | ||
"version": "5.12.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
if [ "${DEV}" = "false" ]; then | ||
echo "Starting test mode" | ||
exec /run.sh | ||
fi | ||
|
||
echo "Starting development mode" | ||
|
||
if grep -i -q alpine /etc/issue; then | ||
exec /usr/bin/supervisord -c /etc/supervisord.conf | ||
elif grep -i -q ubuntu /etc/issue; then | ||
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf | ||
else | ||
echo 'ERROR: Unsupported base image' | ||
exit 1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[supervisord] | ||
nodaemon=true | ||
user=root | ||
|
||
[program:grafana] | ||
user=root | ||
directory=/var/lib/grafana | ||
command=bash -c 'while [ ! -f /root/grafana-bigquery-datasource/dist/gpx_bigquery* ]; do sleep 1; done; /run.sh' | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
killasgroup=true | ||
stopasgroup=true | ||
autostart=true | ||
|
||
[program:delve] | ||
user=root | ||
command=/bin/bash -c 'pid=""; while [ -z "$pid" ]; do pid=$(pgrep -f gpx_bigquery); done; /root/go/bin/dlv attach --api-version=2 --headless --continue --accept-multiclient --listen=:2345 $pid' | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
killasgroup=false | ||
stopasgroup=false | ||
autostart=true | ||
autorestart=true | ||
|
||
[program:build-watcher] | ||
user=root | ||
command=/bin/bash -c 'while inotifywait -e modify,create,delete -r /var/lib/grafana/plugins/grafana-bigquery-datasource; do echo "Change detected, restarting delve...";supervisorctl restart delve; done' | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
killasgroup=true | ||
stopasgroup=true | ||
autostart=true | ||
|
||
[program:mage-watcher] | ||
user=root | ||
environment=PATH="/usr/local/go/bin:/root/go/bin:%(ENV_PATH)s" | ||
directory=/root/grafana-bigquery-datasource | ||
command=/bin/bash -c 'git config --global --add safe.directory /root/grafana-bigquery-datasource && mage -v watch' | ||
stdout_logfile=/dev/fd/1 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
killasgroup=true | ||
stopasgroup=true | ||
autostart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as webpack from 'webpack'; | ||
|
||
const PLUGIN_NAME = 'BuildModeWebpack'; | ||
|
||
export class BuildModeWebpackPlugin { | ||
apply(compiler: webpack.Compiler) { | ||
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => { | ||
compilation.hooks.processAssets.tap( | ||
{ | ||
name: PLUGIN_NAME, | ||
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS, | ||
}, | ||
async () => { | ||
const assets = compilation.getAssets(); | ||
for (const asset of assets) { | ||
if (asset.name.endsWith('plugin.json')) { | ||
const pluginJsonString = asset.source.source().toString(); | ||
const pluginJsonWithBuildMode = JSON.stringify( | ||
{ | ||
...JSON.parse(pluginJsonString), | ||
buildMode: compilation.options.mode, | ||
}, | ||
null, | ||
4 | ||
); | ||
compilation.updateAsset(asset.name, new webpack.sources.RawSource(pluginJsonWithBuildMode)); | ||
} | ||
} | ||
} | ||
); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.