sharded-gotify/.travis.yml

56 lines
1.1 KiB
YAML

language: go
notifications:
email: false
services:
- docker
env:
- GO111MODULE=on
before_install:
- eval "$(gimme $(< GO_VERSION))";
- make download-tools
install:
- go get
- (cd ui && npm install)
script:
# packr builds a go file for all packr "boxes", this would be f.ex. the spec.json file.
- make build-js
- packr
- make test
- make check
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- >
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
export BEFORE_DEPLOY_RUN=1;
if [[ $TRAVIS_TAG != "v"* ]]; then exit 1; fi;
export VERSION=$(echo $TRAVIS_TAG | cut -c 2-);
export LD_FLAGS="-w -s -X main.Version=${VERSION} -X main.BuildDate=$(date "+%F-%T") -X main.Commit=$(git rev-parse --verify HEAD) -X main.Mode=prod";
make build
make package-zip;
ls -lath build;
make build-docker;
fi
deploy:
- provider: releases
api_key: $GH_TOKEN
file_glob: true
file: build/*.zip
skip_cleanup: true
on:
tags: true
- provider: script
script: bash docker-push.sh
skip_cleanup: true
on:
tags: true