forked from gotify/server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
63 lines (53 loc) · 1.26 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
language: go
sudo: required
notifications:
email: false
services:
- docker
env:
- GO111MODULE=on
cache:
directories:
- $HOME/gopath/pkg/mod
before_install:
- nvm install 12.10.0
- export GIMME_GO=$(< GO_VERSION)
- eval "$(gimme ${GIMME_GO%.0})";
- make download-tools
install:
- go get
- (cd ui && yarn)
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
sudo chown -R travis:travis 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