-
Notifications
You must be signed in to change notification settings - Fork 26
/
.travis.yml
44 lines (37 loc) · 1.45 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
language: go
go:
- "1.10"
branches:
except:
- /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/
services:
- docker
- mongodb
env:
global:
- IMPORT_PEFIX=github.com/open-horizon
- EDGE_COMPONENT_NAME=edge-sync-service
- BUILD_FLAGS='-i -tags "netgo"'
- LD_FLAGS="-linkmode external -extldflags -static -s -w"
- BUILD_OUTPUT=build
install:
# Prepare for build
- ./get_dependencies.sh
- mkdir -p build
before_script:
#
script:
# Build
- env GOOS=linux GOARCH=amd64 CGO_BUILD=0 go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/${EDGE_COMPONENT_NAME} ${IMPORT_PEFIX}/${EDGE_COMPONENT_NAME}/cmd/${EDGE_COMPONENT_NAME}
#
# Run coverage
- ./runCoverage.sh
#
# Build samples
- env GOOS=linux GOARCH=amd64 CGO_BUILD=0 go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/edge-sync-service-mgmt ${IMPORT_PEFIX}/${EDGE_COMPONENT_NAME}/cmd/edge-sync-service-mgmt
- env GOOS=linux GOARCH=amd64 CGO_BUILD=0 go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/receive-file ${IMPORT_PEFIX}/${EDGE_COMPONENT_NAME}/cmd/receive-file
- env GOOS=linux GOARCH=amd64 CGO_BUILD=0 go build ${BUILD_FLAGS} -ldflags "${LD_FLAGS}" -o ${BUILD_OUTPUT}/send-file ${IMPORT_PEFIX}/${EDGE_COMPONENT_NAME}/cmd/send-file
after_success:
#
after_script:
#- $HOME/build.common/bin/notify-slack.sh