-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update circleci to automate release * add html test coverage * update vendor * add placeholder tests * add changelog * add more build types
- Loading branch information
Showing
95 changed files
with
9,923 additions
and
8 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,26 +1,153 @@ | ||
version: 2 | ||
|
||
aliases: | ||
# Workflow filters | ||
- &filter-only-master | ||
branches: | ||
only: master | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/golang:1.12.4 | ||
- image: circleci/golang:1.13.5 | ||
working_directory: /go/src/github.com/grafana/grafana-kiosk | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build | ||
command: make | ||
cmd-lint: | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- bin | ||
|
||
cmd_lint: | ||
docker: | ||
- image: circleci/golang:1.12.4 | ||
- image: circleci/golang:1.13.5 | ||
working_directory: /go/src/github.com/grafana/grafana-kiosk | ||
steps: | ||
- checkout | ||
- run: | ||
name: backend lint | ||
command: build/circle-cmd-lint.sh | ||
|
||
cmd_test: | ||
docker: | ||
- image: circleci/golang:1.13.5 | ||
working_directory: /go/src/github.com/grafana/grafana-kiosk | ||
steps: | ||
- checkout | ||
- run: | ||
name: Test and Coverage | ||
command: | | ||
mkdir -p coverage | ||
#go test -covermode=count -coverprofile=coverage/count.out ./... | ||
go test -v -coverpkg=./... --coverprofile=coverage/coverage.out ./... | ||
go test ./... -coverprofile coverage/cover.out; go tool cover -func coverage/cover.out | ||
go tool cover -html=coverage/coverage.out -o coverage/coverage.html | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- coverage | ||
- store_artifacts: | ||
path: coverage | ||
|
||
publish_github_release: | ||
working_directory: /go/src/github.com/grafana/grafana-kiosk | ||
docker: | ||
- image: cibuilds/github:0.13 | ||
steps: | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "52:8e:b7:7c:df:cc:06:98:e4:65:45:a8:4a:fa:15:3b" | ||
- checkout | ||
- attach_workspace: | ||
at: . | ||
- run: | ||
name: "Publish Release on GitHub" | ||
command: | | ||
PROJECT_NAME=grafana-kiosk | ||
RELEASE_NOTES=`awk 'BEGIN {FS="##"; RS=""} FNR==3 {print; exit}' CHANGELOG.md` | ||
VERSION=`awk 'BEGIN {FS="##"; RS=""} FNR==2 {print; exit}' CHANGELOG.md | cut -f2 -d' '` | ||
# create zip file | ||
echo "Creating ZIP" | ||
cd /go/src/github.com/grafana | ||
zip \ | ||
-x grafana-kiosk/.circleci/**\* \ | ||
-x grafana-kiosk/.git/**\* \ | ||
-x grafana-kiosk/.gitignore \ | ||
-x grafana-kiosk/Gopkg.lock \ | ||
-x grafana-kiosk/Gopkg.toml \ | ||
-x grafana-kiosk/Makefile \ | ||
-x grafana-kiosk/build/**\* \ | ||
-x grafana-kiosk/coverage/**\* \ | ||
-x grafana-kiosk/pkg/**\* \ | ||
-x grafana-kiosk/vendor/**\* \ | ||
-r /tmp/grafana-kiosk-${VERSION}.zip \ | ||
grafana-kiosk | ||
# create tar file | ||
echo "Creating TAR" | ||
tar \ | ||
--exclude .circleci \ | ||
--exclude .git \ | ||
--exclude .gitignore \ | ||
--exclude Gopkg.lock \ | ||
--exclude Gopkg.toml \ | ||
--exclude Makefile \ | ||
--exclude build \ | ||
--exclude coverage \ | ||
--exclude pkg \ | ||
--exclude vendor \ | ||
-cvf /tmp/grafana-kiosk-${VERSION}.tar \ | ||
grafana-kiosk | ||
gzip /tmp/grafana-kiosk-${VERSION}.tar | ||
# create artifacts | ||
mkdir -p /go/src/github.com/grafana/grafana-kiosk/artifacts | ||
mv /tmp/grafana-kiosk-${VERSION}.zip /go/src/github.com/grafana/grafana-kiosk/artifacts/ | ||
mv /tmp/grafana-kiosk-${VERSION}.tar.gz /go/src/github.com/grafana/grafana-kiosk/artifacts/ | ||
cd /go/src/github.com/grafana/grafana-kiosk | ||
ls -al | ||
git config user.email "eng@grafana.com" | ||
git config user.name "CircleCI Automation" | ||
git checkout -b release-${VERSION} | ||
git add --force artifacts | ||
git add --force bin | ||
git add --force coverage | ||
git commit -m "automated release $VERSION [skip ci]" | ||
git push -f origin release-${VERSION} | ||
git tag -f v${VERSION} | ||
git push -f origin v${VERSION} | ||
ghr \ | ||
-t ${GITHUB_TOKEN} \ | ||
-u ${CIRCLE_PROJECT_USERNAME} \ | ||
-r ${CIRCLE_PROJECT_REPONAME} \ | ||
-c ${CIRCLE_SHA1} \ | ||
-n "${PROJECT_NAME} v${VERSION}" \ | ||
-b "${RELEASE_NOTES}" \ | ||
-delete \ | ||
v${VERSION} \ | ||
./artifacts/ | ||
- store_artifacts: | ||
path: artifacts | ||
- store_artifacts: | ||
path: coverage | ||
|
||
workflows: | ||
version: 2 | ||
build: | ||
build_workflow: | ||
jobs: | ||
- cmd-lint | ||
- cmd_lint | ||
- cmd_test | ||
- build: | ||
requires: | ||
- cmd_lint | ||
- cmd_test | ||
- approve_release: | ||
type: approval | ||
requires: | ||
- build | ||
filters: *filter-only-master | ||
- publish_github_release: | ||
requires: | ||
- approve_release | ||
filters: *filter-only-master |
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,2 @@ | ||
bin/ | ||
coverage/ |
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,12 @@ | ||
# Change Log | ||
|
||
## 1.0.1 | ||
|
||
- Automated build | ||
- Includes PR #15 | ||
- Compatible with Grafana v6.4.1+ | ||
|
||
## 1.0.0 | ||
|
||
- First Release | ||
- Compatible with Grafana v6.3 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.