This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from sbueringer/pr-rewrite-grafana7
Pr rewrite grafana7
- Loading branch information
Showing
767 changed files
with
12,577 additions
and
400,633 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
|
||
[*.{js,ts,tsx,scss}] | ||
quote_type = single | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,7 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,112 @@ | ||
|
||
name: ci | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
env: | ||
CONSUL_VERSION: '1.8.4' | ||
GOLANGCI_LINT_VERSION: '1.32.2' | ||
MAGE_VERSION: '1.10.0' | ||
NODE_VERSION: '12.x' | ||
YARN_VERSION: '1.21.1' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get the version & set it in package.json | ||
id: get_version | ||
run: | | ||
VERSION=${GITHUB_REF/refs\/tags\/v/} | ||
echo ::set-output name=VERSION::${VERSION} | ||
sed -i "s/1.0.0/${VERSION}/g" package.json | ||
- name: Use Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install Consul | ||
run: | | ||
# Install some binaries when not running locally | ||
if ! command -v sudo &> /dev/null | ||
then | ||
apt update | ||
# procps required to execute syctl to find free ports for Consul | ||
apt install zip unzip procps -y | ||
fi | ||
mkdir -p $GITHUB_WORKSPACE/bin | ||
curl -sLo consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip | ||
unzip consul.zip | ||
rm -rf consul.zip | ||
mv consul $GITHUB_WORKSPACE/bin | ||
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
|
||
- name: Install Mage | ||
uses: nickhstr/[email protected] | ||
with: | ||
version: ${{ env.MAGE_VERSION }} | ||
|
||
- name: Install golangci-lint | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v${{ env.GOLANGCI_LINT_VERSION }} | ||
- name: Build and test frontend | ||
run: | | ||
yarn install | ||
./node_modules/.bin/grafana-toolkit plugin:ci-build | ||
- name: Build and test backend | ||
run: | | ||
mage -v buildAll | ||
export CGO_ENABLED=0 | ||
mage -v lint | ||
mage -v coverage | ||
- name: Move results to ci folder and package distro | ||
env: | ||
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }} | ||
run: | | ||
./node_modules/.bin/grafana-toolkit plugin:ci-build --finish | ||
./node_modules/.bin/grafana-toolkit plugin:ci-package | ||
ls -la ./ci/jobs/package | ||
ls -la ./ci/packages | ||
ls -la ./ci/dist | ||
ls -la ./ci/grafana-test-env | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: | | ||
TODO: change me | ||
draft: true | ||
prerelease: false | ||
|
||
- name: Upload plugin to release | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./ci/packages/sbueringer-consul-datasource-${{ steps.get_version.outputs.VERSION }}.zip | ||
asset_name: sbueringer-consul-datasource-${{ steps.get_version.outputs.VERSION }}.zip | ||
asset_content_type: application/zip |
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,13 +1,30 @@ | ||
node_modules | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
*.iml | ||
node_modules/ | ||
|
||
# Build artifacts | ||
/.tscache | ||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Test artifacts | ||
/dist/src | ||
/dist/test | ||
/dist/spec | ||
/.nyc_output | ||
/coverage | ||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
dist/ | ||
artifacts/ | ||
work/ | ||
ci/ | ||
e2e-results/ | ||
|
||
# Editor | ||
.idea |
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,32 @@ | ||
run: | ||
deadline: 10m | ||
|
||
concurrency: 4 | ||
|
||
# skip-dirs: | ||
# - vendor/ | ||
|
||
# skip-files: | ||
|
||
linters: | ||
disable-all: true | ||
fast: false | ||
enable: | ||
- goimports | ||
- golint | ||
- govet | ||
- gofmt | ||
- structcheck | ||
- staticcheck | ||
- varcheck | ||
- interfacer | ||
- unconvert | ||
- ineffassign | ||
- goconst | ||
- misspell | ||
- nakedret | ||
- deadcode | ||
|
||
issues: | ||
max-issues-per-linter: 100 | ||
max-same-issues: 50 |
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,3 @@ | ||
module.exports = { | ||
...require("./node_modules/@grafana/toolkit/src/config/prettier.plugin.config.json"), | ||
}; |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
|
||
# v0.1.9 - 2020-11-11 | ||
|
||
Complete rewrite of the plugin for Grafana 7.x. | ||
|
||
Highlights: | ||
* Anonymous Consul authentication (without token) | ||
* Plugin is now signed |
Oops, something went wrong.