forked from BuildOnViction/victionchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
110 lines (99 loc) · 3.94 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
sudo: required
language: go
go_import_path: github.com/tomochain/tomochain
env:
global:
- GOPROXY=https://proxy.golang.org
- GO111MODULE=on
jobs:
include:
- stage: Lint
sudo: false
go: '1.12.x'
git:
submodules: false
script:
- go run build/ci.go lint
- stage: Build and test
go: '1.12.x'
script:
- sudo modprobe fuse
- sudo chmod 666 /dev/fuse
- sudo chown root:$USER /etc/fuse.conf
- go run build/ci.go install
- while sleep 540; do echo "[ still running ]"; done &
- go run build/ci.go test -coverage
- kill %1
after_success:
- bash <(curl -s https://codecov.io/bash)
- go: '1.11.x'
script:
- sudo modprobe fuse
- sudo chmod 666 /dev/fuse
- sudo chown root:$USER /etc/fuse.conf
- go run build/ci.go install
- while sleep 540; do echo "[ still running ]"; done &
- go run build/ci.go test -coverage
- kill %1
- stage: Github release
go: '1.12.x'
script:
- GOARCH=amd64 GOOS=linux go build -o ./build/bin/tomo-linux-amd64 -v ./cmd/tomo
deploy:
provider: releases
api_key: $GITHUB_TOKEN
overwrite: true
file_glob: true
file: build/bin/tomo-*
skip_cleanup: true
on:
tags: true
- stage: Build and push image
services:
- docker
install: skip
before_script:
- docker build -t tomochain/tomochain .
- docker build -t tomochain/node -f Dockerfile.node .
script:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker tag tomochain/tomochain tomochain/tomochain:latest
- docker push tomochain/tomochain:latest
- docker tag tomochain/tomochain tomochain/tomochain:$TRAVIS_BUILD_ID
- docker push tomochain/tomochain:$TRAVIS_BUILD_ID
- docker tag tomochain/node tomochain/node:latest
- docker push tomochain/node:latest
- docker tag tomochain/node tomochain/node:$TRAVIS_BUILD_ID
- docker push tomochain/node:$TRAVIS_BUILD_ID
- stage: Build and push image (tagged)
services:
- docker
install: skip
before_script:
- docker build -t tomochain/tomochain .
- docker build -t tomochain/tomochain -f Dockerfile.node .
script:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker tag tomochain/tomochain tomochain/tomochain:latest
- docker push tomochain/tomochain:latest
- docker tag tomochain/tomochain tomochain/tomochain:$TRAVIS_TAG
- docker push tomochain/tomochain:$TRAVIS_TAG
- docker tag tomochain/tomochain tomochain/node:latest
- docker push tomochain/node:latest
- docker tag tomochain/node tomochain/node:$TRAVIS_TAG
- docker push tomochain/node:$TRAVIS_TAG
stages:
- name: Lint
- name: Build and test
- name: Github release
if: type != pull_request AND branch =~ ^v AND tag IS present AND repo = tomochain/tomochain
- name: Build and push image
if: type != pull_request AND branch = master AND tag IS blank AND repo = tomochain/tomochain
- name: Build and push image (tagged)
if: type != pull_request AND branch =~ ^v AND tag IS present AND repo = tomochain/tomochain
notifications:
slack:
rooms:
secure: DoWVSWEKZre0rsYvHPqOBpYa5hL7DagVCP7eGR+2dluzsyUOTW58uiaezaZMAPPG6k7i1TC9CufONkFRwH6kqLrFtAFd+t3sKb3X4D9/PSa9k88uBuNfsX+JhUzEMT53pfLO9NTBbZs3M6bOuZDP7GddWWnMZpO6Mu7RzZtVxyqbZIcNu3nxsmLkoaQ8726npaHrxhO1Ab+3rgR4dkNFLgl9/CnPwvuv/j24dsKzly6tF+4Ms9Fz5O0Te8zK5d/UWZN50e+uDnbzcIvbY2VHOYXchXZRbfKO8/M2TIXLPKbLc3alCw1ZvpFZqiMYK3SnGNby4FLp8RlC6H4sv52YeNq3fHH8SgOJ3xTL8m6ejIlqoKnUNsJ1lwtfiEVu5D1b8FRKTPqoh+cjadJxsF9dO0xZsf1d5Pmq6Ncr0j6di1ZMjCc6TPFERxkdA48+PzQY4TqfBpM4E5RnJuX9O9MJFbA1fZo2xhHcy0LlkslZMpSwiv/YO4bCJZPmxvHtruqELJXxjYyC67UbzSzrBVE1g1bXy0V5xyxPIEA38jzlNczhq6fg2gyEc+6JCbzN2gFoAS5uFWQHpUhXHc7zNB5Jyi7GPQv6cfHYcedjn9In9/bNDqqGexGX4Ih/cb6W1GOHC7c2A/AsfTa9KWmsyj7YwBRXFIXfme7bBh6VGuRqU3Y=
on_success: change
on_failure: always