git config --global url."ssh://[email protected]:cloudwicklabs/".insteadOf "https://github.com/cloudwicklabs/"
npm run dev && mage -v && \
npx @grafana/sign-plugin@latest --rootUrls https://example.com/amorphic,http://127.0.0.1:3000 && \
docker-compose up --build
Make sure you have the following dependencies installed first:
-
Install dependencies
yarn install --pure-lockfile
-
Build plugin in development mode or run in watch mode
yarn dev
or
yarn watch
-
Build plugin in production mode
yarn build
-
Build the backend binaries
mage -v
Setting up go workspace can be helpful when making changes across modules like grafana-aws-sdk
and sqlds
and wanting to see those changes reflected in the Athena data source.
From https://go.dev/blog/get-familiar-with-workspaces:
Workspaces in Go 1.18 let you work on multiple modules simultaneously without having to edit go.mod files for each module. Each module within a workspace is treated as a main module when resolving dependencies.
Previously, to add a feature to one module and use it in another module, you needed to either publish the changes to the first module, or edit the go.mod file of the dependent module with a replace directive for your local, unpublished module changes. In order to publish without errors, you had to remove the replace directive from the dependent module’s go.mod file after you published the local changes to the first module.
- Make a new directory somewhere, for example
athena_workspace
cd athena_workspace
git clone https://github.com/grafana/athena-datasource.git
git clone https://github.com/grafana/grafana-aws-sdk
git clone https://github.com/grafana/sqlds
go work init ./athena-datasource ./grafana-aws-sdk ./sqlds
- Make modifications in any of these directories and build the backend in
athena-datasource
withmage
as usual. The changes in these directories will be taken into account.
If you build Grafana locally, you can for example symlink athena-datasource
to your clone of github.com/grafana/grafana
's data/plugins
directory, e.g. cd <path to your Grafana repo>/github.com/grafana/grafana/data/plugins && ln -s <path to your workspaces>/athena_workspace/athena-datasource athena-datasource
Before doing a release, make sure that the GitHub repository is configured with a GRAFANA_API_KEY
to be able to sign the plugin and that the Golang and Node versions in the release.yaml workflow are correct.
Also, make sure that the path to the plugin validator in the release.yaml is correct (this fixes the error pushd: ./plugin-validator/cmd/plugincheck: No such file or directory
):
pushd ./plugin-validator/pkg/cmd/plugincheck`
You need to have commit rights to the GitHub repository to publish a release.
- Update the version number in the
package.json
file. - Update the
CHANGELOG.md
with the changes contained in the release. - Commit the changes to master and push to GitHub.
- Follow the Drone release process that you can find here