forked from BitcoinBeastie/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
61 lines (54 loc) · 1.47 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
os: linux
dist: xenial
language: go
go_import_path: github.com/lbryio/lighthouse
go:
- 1.13
install: true
services:
- docker
- elasticsearch
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
before_script:
- sleep 10 # Need to give time for elastic search to start
script:
#Fetch master to be used in deploy condition to prevent deploying on old commits.
- git fetch origin master:master
- ./scripts/build.sh
- go test ./...
- ./scripts/lint.sh
- ./bin/lighthouse serve &
- sleep 10s
- "curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' http://localhost:50005/"
- go mod tidy
- git diff --exit-code
deploy:
# uploads per commit builds
- provider: s3
bucket: "build.lbry.io"
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
local-dir: bin
upload-dir: "lighthouse/branch-${TRAVIS_BRANCH}/commit-${TRAVIS_COMMIT:0:7}/build-${TRAVIS_BUILD_NUMBER}"
on:
all_branches: true
# upload latest successful build per branch
- provider: s3
bucket: "build.lbry.io"
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
local-dir: bin
upload-dir: "lighthouse/branch-${TRAVIS_BRANCH}"
on:
all_branches: true
# creates and publishes new docker image per branch
- provider: script
script: bash docker/docker.sh
skip_cleanup: true
on:
all_branches: true