forked from TheThingsNetwork/lorawan-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
139 lines (139 loc) · 4.54 KB
/
.travis.yml
File metadata and controls
139 lines (139 loc) · 4.54 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
sudo: required
conditions: v1
if: type = pull_request OR branch = master OR tag IS present
os: linux
git:
depth: false
language: go
go: 1.12.x
go_import_path: go.thethings.network/lorawan-stack
env:
global:
- GOPROXY=https://proxy.golang.org
- NODE_ENV=production
- YARN_CACHE_FOLDER=$HOME/.cache/yarn
- MAGE=$HOME/.cache/mage/mage
- TEST_SLOWDOWN=8
- TEST_REDIS=1
- PATH=/snap/bin:$PATH
- HUGO_BASE_URL=https://thethingsnetwork.github.io/lorawan-stack/
matrix:
include:
- env: RUNTYPE=js
- env: RUNTYPE=go.test RUN_GOARCH=amd64
- env: RUNTYPE=go.test RUN_GOARCH=386
- env: RUNTYPE=go.lint
- env: RUNTYPE=release
if: tag IS present OR (type != pull_request AND branch = master)
services:
- docker
cache:
directories:
- "$GOPATH/pkg/mod"
- "$HOME/.cache/go-build"
- "$HOME/.cache/mage"
- "$HOME/.cache/yarn"
before_install:
- |
if [[ "$TRAVIS_EVENT_TYPE" == "push" ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then
set -e
go clean -modcache
go clean -cache
rm -rf $HOME/.cache/mage/*
rm -rf $HOME/.cache/yarn/*
fi
- |
if [[ ! -z "$encrypted_fc3d5d829302_key" ]]; then
openssl aes-256-cbc -K $encrypted_fc3d5d829302_key \
-iv $encrypted_fc3d5d829302_iv \
-in pkg/blob/testdata/gcloud.json.enc \
-out pkg/blob/testdata/gcloud.json \
-d
fi
- |
if [[ "$RUNTYPE" == "go.test" ]]; then
set -e
sudo rm /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m) > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
fi
- |
if [[ "$RUNTYPE" == "release" ]]; then
openssl aes-256-cbc -K $encrypted_82ec1379e985_key -iv $encrypted_82ec1379e985_iv -in snapcraft.login.enc -out snapcraft.login -d
nvm install 10.16.0
fi
- |
if [[ "$RUNTYPE" == "js" ]]; then
nvm install 10.16.0
fi
install:
- make init
- |
if [[ "$RUNTYPE" == "js" ]]; then
$MAGE js:devDeps js:deps jsSDK:deps
fi
- |
if [[ "$RUNTYPE" == "release" ]]; then
set -e
sudo apt-get -y update
sudo apt-get install -y rpm snapd
sudo snap install snapcraft --classic
$MAGE jsSDK:deps js:deps
$MAGE docs:deps
fi
before_script:
- |
if [[ "$RUNTYPE" == "go.test" ]]; then
set -e
make dev.databases.start
fi
script:
- if [[ "$RUNTYPE" == "js" ]]; then $MAGE proto:swaggerClean proto:swagger; fi
- if [[ "$RUNTYPE" == "js" ]]; then $MAGE proto:markdownClean proto:markdown; fi
- if [[ "$RUNTYPE" == "js" ]]; then $MAGE proto:jsSDKClean proto:jsSDK; fi
- if [[ "$RUNTYPE" == "js" ]]; then $MAGE jsSDK:clean jsSDK:build; fi
- if [[ "$RUNTYPE" == "js" ]]; then $MAGE js:translations; fi
- if [[ "$RUNTYPE" == "js" ]]; then $MAGE js:test jsSDK:test; fi
- if [[ "$RUNTYPE" == "js" ]]; then $MAGE js:lint; fi
- if [[ "$RUNTYPE" == "go.lint" ]]; then $MAGE headers:check; fi
- if [[ "$RUNTYPE" == "go.lint" ]]; then $MAGE proto:goClean proto:go; fi
- if [[ "$RUNTYPE" == "go.lint" ]]; then $MAGE go:messages; fi
- if [[ "$RUNTYPE" == "go.lint" ]]; then $MAGE go:lint; fi
- if [[ "$RUNTYPE" == "go.lint" ]]; then $MAGE go:unconvert; fi
- if [[ "$RUNTYPE" == "go.lint" ]]; then $MAGE go:fmt; fi
- if [[ "$RUNTYPE" == "go.lint" ]]; then $MAGE go:misspell; fi
- |
if [[ "$RUNTYPE" == "go.test" ]]; then
if [[ "$RUN_GOARCH" == "amd64" ]]; then
GOARCH=$RUN_GOARCH $MAGE go:coveralls
else
GOARCH=$RUN_GOARCH $MAGE go:test
fi
fi
- if [[ "$RUNTYPE" == "go.test" ]]; then $MAGE go:testBinaries; fi
- if [[ "$RUNTYPE" == "release" ]]; then $MAGE version:files; fi
- if [[ "$RUNTYPE" == "release" ]]; then $MAGE docs:build; fi
- make git.diff
after_success:
- |
if [[ "$RUNTYPE" == "release" ]]; then
set -e
$MAGE js:build
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
snapcraft login --with snapcraft.login
if [[ ! -z "$TRAVIS_TAG" ]]; then
GO111MODULE=on go run github.com/goreleaser/goreleaser --release-notes <(go run github.com/TheThingsIndustries/release-notes -owner TheThingsNetwork -repo lorawan-stack -id "release-notes" -head $(git rev-parse HEAD))
else
GO111MODULE=on go run github.com/goreleaser/goreleaser --snapshot --release-notes <(go run github.com/TheThingsIndustries/release-notes -owner TheThingsNetwork -repo lorawan-stack -id "release-notes" -head $(git rev-parse HEAD))
fi
fi
deploy:
- provider: pages
local_dir: doc/public
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: true
on:
tags: true
condition: $RUNTYPE = "release"