Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into timepicker-tooltip
Browse files Browse the repository at this point in the history
* grafana/master: (450 commits)
  build: duplicate docker run-script removed.
  Set User-Agent header in all proxied datasource requests
  docs: cloudwatch dimensions reference link.
  docs: remove message property in response from get alerts http api
  changelog: add notes about closing grafana#5623
  build: cleanup
  build: fixes rpm verification.
  docs: add grafana version note for gitlab oauth
  docs: gitlab: add note about more restrictive API scope
  social: gitlab_oauth: set user ID in case email changes
  docs: document GitLab authentication backend
  social: add GitLab authentication backend
  build: verifies the rpm packages signatures.
  changelog: add notes about closing grafana#12224
  docs: update
  feat: add auto fit panels to shortcut modal, closes grafana#12768
  changelog: add notes about closing grafana#12680
  docs: update postgres provisioning
  Remove dependencies
  Rename test files
  ...
  • Loading branch information
ryantxu committed Aug 16, 2018
2 parents 44668a0 + 8af80b3 commit 3afeddd
Show file tree
Hide file tree
Showing 533 changed files with 21,756 additions and 13,244 deletions.
2 changes: 1 addition & 1 deletion .bra.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ watch_dirs = [
"$WORKDIR/public/views",
"$WORKDIR/conf",
]
watch_exts = [".go", ".ini", ".toml"]
watch_exts = [".go", ".ini", ".toml", ".template.html"]
build_delay = 1500
cmds = [
["go", "run", "build.go", "-dev", "build-server"],
Expand Down
187 changes: 166 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ aliases:
ignore: /.*/
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- &filter-not-release
- &filter-not-release-or-master
tags:
ignore: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: master
- &filter-only-master
branches:
only: master

version: 2

Expand Down Expand Up @@ -85,6 +90,9 @@ jobs:
- run:
name: run linters
command: 'gometalinter.v2 --enable-gc --vendor --deadline 10m --disable-all --enable=deadcode --enable=ineffassign --enable=structcheck --enable=unconvert --enable=varcheck ./...'
- run:
name: run go vet
command: 'go vet ./pkg/...'

test-frontend:
docker:
Expand All @@ -96,6 +104,7 @@ jobs:
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
no_output_timeout: 15m
- save_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
paths:
Expand Down Expand Up @@ -138,6 +147,12 @@ jobs:
- run:
name: sign packages
command: './scripts/build/sign_packages.sh'
- run:
name: verify signed packages
command: |
mkdir -p ~/.rpmdb/pubkeys
curl -s https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana > ~/.rpmdb/pubkeys/grafana.key
./scripts/build/verify_signed_packages.sh dist/*.rpm
- run:
name: sha-sum packages
command: 'go run build.go sha-dist'
Expand All @@ -150,8 +165,65 @@ jobs:
- dist/grafana*
- scripts/*.sh
- scripts/publish
- store_artifacts:
path: dist

build:
docker:
- image: grafana/build-container:1.0.0
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run:
name: prepare build tools
command: '/tmp/bootstrap.sh'
- run:
name: build and package grafana
command: './scripts/build/build.sh'
- run:
name: sign packages
command: './scripts/build/sign_packages.sh'
- run:
name: sha-sum packages
command: 'go run build.go sha-dist'
- persist_to_workspace:
root: .
paths:
- dist/grafana*

grafana-docker-master:
docker:
- image: docker:stable-git
steps:
- checkout
- attach_workspace:
at: .
- setup_remote_docker
- run: docker info
- run: cp dist/grafana-latest.linux-x64.tar.gz packaging/docker
- run: cd packaging/docker && ./build-deploy.sh "master-${CIRCLE_SHA1}"

grafana-docker-pr:
docker:
- image: docker:stable-git
steps:
- checkout
- attach_workspace:
at: .
- setup_remote_docker
- run: docker info
- run: cp dist/grafana-latest.linux-x64.tar.gz packaging/docker
- run: cd packaging/docker && ./build.sh "${CIRCLE_SHA1}"

grafana-docker-release:
docker:
- image: docker:stable-git
steps:
- checkout
- attach_workspace:
at: .
- setup_remote_docker
- run: docker info
- run: cp dist/grafana-latest.linux-x64.tar.gz packaging/docker
- run: cd packaging/docker && ./build-deploy.sh "${CIRCLE_TAG}"

build-enterprise:
docker:
Expand All @@ -160,14 +232,34 @@ jobs:
steps:
- checkout
- run:
name: build and package grafana
name: build, test and package grafana enterprise
command: './scripts/build/build_enterprise.sh'
- run:
name: sign packages
command: './scripts/build/sign_packages.sh'
- run:
name: sha-sum packages
command: 'go run build.go sha-dist'
- run:
name: move enterprise packages into their own folder
command: 'mv dist enterprise-dist'
- persist_to_workspace:
root: .
paths:
- enterprise-dist/grafana-enterprise*

deploy-enterprise-master:
docker:
- image: circleci/python:2.7-stretch
steps:
- attach_workspace:
at: .
- run:
name: install awscli
command: 'sudo pip install awscli'
- run:
name: deploy to s3
command: 'aws s3 sync ./enterprise-dist s3://$ENTERPRISE_BUCKET_NAME/master'

deploy-master:
docker:
Expand All @@ -187,9 +279,6 @@ jobs:
- run:
name: Trigger Windows build
command: './scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} master'
- run:
name: Trigger Docker build
command: './scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} master-$(echo "${CIRCLE_SHA1}" | cut -b1-7)'
- run:
name: Publish to Grafana.com
command: |
Expand All @@ -211,28 +300,27 @@ jobs:
- run:
name: Trigger Windows build
command: './scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} release'
- run:
name: Trigger Docker build
command: './scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} ${CIRCLE_TAG}'

workflows:
version: 2
test-and-build:
build-master:
jobs:
- build-all:
filters: *filter-not-release
filters: *filter-only-master
- build-enterprise:
filters: *filter-only-master
- codespell:
filters: *filter-not-release
filters: *filter-only-master
- gometalinter:
filters: *filter-not-release
filters: *filter-only-master
- test-frontend:
filters: *filter-not-release
filters: *filter-only-master
- test-backend:
filters: *filter-not-release
filters: *filter-only-master
- mysql-integration-test:
filters: *filter-not-release
filters: *filter-only-master
- postgres-integration-test:
filters: *filter-not-release
filters: *filter-only-master
- deploy-master:
requires:
- build-all
Expand All @@ -242,9 +330,29 @@ workflows:
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters:
branches:
only: master
filters: *filter-only-master
- grafana-docker-master:
requires:
- build-all
- test-backend
- test-frontend
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master
- deploy-enterprise-master:
requires:
- build-all
- test-backend
- test-frontend
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
- build-enterprise
filters: *filter-only-master

release:
jobs:
- build-all:
Expand All @@ -271,3 +379,40 @@ workflows:
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
- grafana-docker-release:
requires:
- build-all
- test-backend
- test-frontend
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release

build-branches-and-prs:
jobs:
- build:
filters: *filter-not-release-or-master
- codespell:
filters: *filter-not-release-or-master
- gometalinter:
filters: *filter-not-release-or-master
- test-frontend:
filters: *filter-not-release-or-master
- test-backend:
filters: *filter-not-release-or-master
- mysql-integration-test:
filters: *filter-not-release-or-master
- postgres-integration-test:
filters: *filter-not-release-or-master
- grafana-docker-pr:
requires:
- build
- test-backend
- test-frontend
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters: *filter-not-release-or-master
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
.git
.gitignore
.github
.vscode
bin
data*
dist
docker
Dockerfile
docs
dump.rdb
node_modules
Expand Down
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Follow the setup guide in README.md

### Rebuild frontend assets on source change
```
grunt && grunt watch
yarn watch
```

### Rerun tests on source change
```
grunt karma:dev
yarn jest
```

### Run tests for backend assets before commit
Expand All @@ -17,6 +17,6 @@ test -z "$(gofmt -s -l . | grep -v -E 'vendor/(github.com|golang.org|gopkg.in)'

### Run tests for frontend assets before commit
```
npm test
yarn test
go test -v ./pkg/...
```
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ fig.yml
docker-compose.yml
docker-compose.yaml
/conf/provisioning/**/custom.yaml
/conf/provisioning/**/dev.yaml
/conf/ldap_dev.toml
profile.cov
/grafana
/local
Expand All @@ -56,6 +58,7 @@ debug.test
/examples/*/dist
/packaging/**/*.rpm
/packaging/**/*.deb
/packaging/**/*.tar.gz

# Ignore OSX indexing
.DS_Store
Expand Down
13 changes: 0 additions & 13 deletions .jscs.json

This file was deleted.

37 changes: 0 additions & 37 deletions .jshintrc

This file was deleted.

Loading

0 comments on commit 3afeddd

Please sign in to comment.