-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
68 lines (62 loc) · 2.52 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
sudo: true
language: go
go:
- "1.20.x"
service:
- docker
env:
- GO111MODULE=on
install: true
jobs:
include:
- stage: check the go code
before_install:
- sudo apt-get update
- sudo apt-get install -y libpcap-dev
script:
- cd grpc/go/kubedge_server/
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o goserv .
- cd ../../../grpc/go/kubedge_client/
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o goclient .
- cd ../../../arpscan/
- CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o arpscan .
- cd ../cmdrun/
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o cmdrun .
- cd ..
# - stage: build python docker image
# script:
# - export DBLUETOOTHREPO=$DOCKER_NAMESPACE/bluetooth_detect-dev
# - export VERSION=0.1.0
# - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# - docker build -t $DBLUETOOTHREPO:$VERSION -f images/bluetooth_detect/Dockerfile .
# - docker images
# - docker tag $DBLUETOOTHREPO:$VERSION $DBLUETOOTHREPO:latest
# - docker tag $DBLUETOOTHREPO:$VERSION $DBLUETOOTHREPO:travis-$TRAVIS_BUILD_NUMBER
# - docker push $DBLUETOOTHREPO
- stage: build health docker image
before_install:
- sudo apt-get update
- sudo apt-get install -y libpcap-dev
script:
- export DHEALTHREPO=$DOCKER_NAMESPACE/kubesim_health-dev
- export VERSION=0.1.23
- cd health/
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o build/_output/bin/healthsrv -gcflags all=-trimpath=${GOPATH} -asmflags all=-trimpath=${GOPATH} -tags=v1 ./cmd/...
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t $DHEALTHREPO:$VERSION -f build/Dockerfile .
- cd ..
- docker images
- docker tag $DHEALTHREPO:$VERSION $DHEALTHREPO:latest
- docker tag $DHEALTHREPO:$VERSION $DHEALTHREPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $DHEALTHREPO:$VERSION
- docker push $DHEALTHREPO:latest
- docker push $DHEALTHREPO:travis-$TRAVIS_BUILD_NUMBER
- stage: test health docker image
before_install:
- sudo apt-get update
- sudo apt-get install -y libpcap-dev
script:
- export DHEALTHREPO=$DOCKER_NAMESPACE/kubesim_health-dev
- export VERSION=0.1.23
- docker run -d --name test_base $DHEALTHREPO:$VERSION
- docker ps | grep -q test_base