mirror of https://github.com/statping/statping
updates
parent
d4367cc9c9
commit
810487e19e
|
@ -37,15 +37,13 @@ install:
|
||||||
- npm install -g sass
|
- npm install -g sass
|
||||||
- npm install -g newman
|
- npm install -g newman
|
||||||
- pip install --user awscli
|
- pip install --user awscli
|
||||||
- go mod vendor
|
- go mod download
|
||||||
- make dev-deps
|
|
||||||
- make install
|
- make install
|
||||||
before_script:
|
before_script:
|
||||||
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
|
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
|
||||||
- psql -c 'create database test;' -U postgres
|
- psql -c 'create database test;' -U postgres
|
||||||
script:
|
script:
|
||||||
- travis_retry make test-all
|
- travis_retry make test-ci
|
||||||
- make test-api
|
|
||||||
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
|
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
|
||||||
make coverage; fi
|
make coverage; fi
|
||||||
after_success:
|
after_success:
|
||||||
|
|
18
Makefile
18
Makefile
|
@ -30,11 +30,21 @@ reup: down clean compose-build-full up
|
||||||
test: clean
|
test: clean
|
||||||
go test -v -p=4 -ldflags="-X main.VERSION=testing" -coverprofile=coverage.out ./...
|
go test -v -p=4 -ldflags="-X main.VERSION=testing" -coverprofile=coverage.out ./...
|
||||||
|
|
||||||
|
# build all arch's and release Statping
|
||||||
|
release:
|
||||||
|
wget -O statping.gpg $(SIGN_URL)
|
||||||
|
gpg --import statping.gpg
|
||||||
|
make build-all
|
||||||
|
|
||||||
test-ci: clean compile test-deps
|
test-ci: clean compile test-deps
|
||||||
SASS=`which sass` STATPING_DIR=${GOPATH}/src/github.com/statping/statping go test -v -covermode=count -coverprofile=coverage.out -p=4 ./...
|
SASS=`which sass` STATPING_DIR=${GOPATH}/src/github.com/statping/statping go test -v -covermode=count -coverprofile=coverage.out -p=4 ./...
|
||||||
goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS
|
goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS
|
||||||
bash <(curl -s https://codecov.io/bash)
|
bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
||||||
|
test-api:
|
||||||
|
DB_CONN=sqlite DB_HOST=localhost DB_DATABASE=sqlite DB_PASS=none DB_USER=none statping &
|
||||||
|
sleep 5000 && newman run source/tmpl/postman.json -e dev/postman_environment.json --delay-request 500
|
||||||
|
|
||||||
test-deps:
|
test-deps:
|
||||||
go get golang.org/x/tools/cmd/cover
|
go get golang.org/x/tools/cmd/cover
|
||||||
go get github.com/mattn/goveralls
|
go get github.com/mattn/goveralls
|
||||||
|
@ -162,6 +172,14 @@ print_details:
|
||||||
|
|
||||||
build-all: xgo-install build-mac build-linux build-windows build-linux build-alpine compress
|
build-all: xgo-install build-mac build-linux build-windows build-linux build-alpine compress
|
||||||
|
|
||||||
|
coverage: test-deps
|
||||||
|
$(GOPATH)/bin/goveralls -coverprofile=coverage.out -service=travis -repotoken $(COVERALLS)
|
||||||
|
|
||||||
|
# build Statping using a travis ci trigger
|
||||||
|
travis-build: travis_s3_creds upload_to_s3
|
||||||
|
curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Travis-API-Version: 3" -H "Authorization: token $(TRAVIS_API)" -d $(TRAVIS_BUILD_CMD) https://api.travis-ci.com/repo/statping%2Fstatping/requests
|
||||||
|
curl -H "Content-Type: application/json" --data '{"docker_tag": "latest"}' -X POST $(DOCKER)
|
||||||
|
|
||||||
download-key:
|
download-key:
|
||||||
wget -O statping.gpg $(KEY_URL)
|
wget -O statping.gpg $(KEY_URL)
|
||||||
gpg --import statping.gpg
|
gpg --import statping.gpg
|
||||||
|
|
Loading…
Reference in New Issue