AWS IoT Sitewise Datasource Development Guide
Please add feedback to the issues folder, and we will follow up shortly. Be sure to include version information for both grafana and the installed plugin.
The production plugins can be downloaded from the IoT sitewise plugin page.
For configuration options, see: src/README.md
Development builds
To get the latest build artifacts for a branch:
- find the green checkbox after a build
- click link to the "package" details link
- open the "Artifacts" tab
- Pick the appropriate download for your platform
Developer Guide
Build
Getting started
- Install dependencies
yarn install
- Build plugin in development mode or run in watch mode
yarn dev
or
yarn watch
- Build plugin in production mode
yarn build
- Build backend for all platforms
mage buildAll
- Run tests
mage test
Install
Instructions to install grafana server locally can be found, here:
To install the plugin locally, copy the built plugin to the Grafana plugin directory (usually: /var/lib/grafana/plugins
)
Docker development setup
- Create AWS credentials file:
cat << EOF >> ~/.aws/credentials
[DEFAULT]
[default]
aws_access_key_id=<your aws access key id>
aws_secret_access_key=<your aws secret access key>
EOF
- Start Grafana docker
cd /Workspace/iot-sitewise-datasource
yarn server
OR
# Run from directory containing iot-sitewise-datasource clone
cd /Workspace/iot-sitewise-datasource
docker run -e GF_DEFAULT_APP_MODE=development -e AWS_SHARED_CREDENTIALS_FILE="/Users/grafana/.aws/credentials" -d -p 3000:3000 -v ~/.aws/:/Users/grafana/.aws/ -v "$(pwd)"/dist:/var/lib/grafana/plugins --name=grafana grafana/grafana:latest
- Reload plugin
docker restart grafana
Access from http://localhost:3000
.
First time login will be user:admin password:admin
Build a release
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
by copy and pasting the relevant PRs from Github's Release drafter interface or by running npm run generate-release-notes
.
- PR the changes.
- Once merged, follow the Drone release process that you can find here