forked from codenotary/immudb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
100 lines (91 loc) · 4.01 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
dist: bionic
language: go
env:
global:
- SLEEP_TIME=5
git:
depth: false
go:
- 1.13.x
install: true
notifications:
email: false
before_script:
- sudo apt update && sudo apt install curl -y
- curl -L -o /tmp/vcn https://github.com/vchain-us/vcn/releases/download/v0.8.3/vcn-v0.8.3-linux-amd64-static
- CHECKSUM=$(sha256sum /tmp/vcn | cut -d " " -f 1)
- echo $CHECKSUM
- curl -s https://api.codenotary.io/authenticate/$CHECKSUM?org=vchain.us | grep -q :0
- chmod +x /tmp/vcn
jobs:
include:
- stage: Scan
script:
- curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sudo sh -s -- -b $GOPATH/bin latest
- gosec -fmt=json -out=results-${TRAVIS_BUILD_NUMBER}.json -no-fail ./...
- VCN_USER=$gosec_user VCN_PASSWORD=$gosec_pass /tmp/vcn login
- VCN_NOTARIZATION_PASSWORD=$gosec_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --attr --silent results-${TRAVIS_BUILD_NUMBER}.json
- /tmp/vcn logout
- sleep $[ ( $RANDOM % 10 ) + 1 ]s
- VCN_USER=$trv_user VCN_PASSWORD=$trv_pass /tmp/vcn login
- VCN_NOTARIZATION_PASSWORD=$trv_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --silent results-${TRAVIS_BUILD_NUMBER}.json
- /tmp/vcn logout
- stage: Binaries
os: linux
arch:
- amd64
script:
- GOOS=linux GOARCH=amd64 make immudb-static immugw-static immuadmin-static immuclient-static
- VCN_USER=$trv_user VCN_PASSWORD=$trv_pass /tmp/vcn login
- VCN_NOTARIZATION_PASSWORD=$trv_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --silent immudb
- sleep $[ ( $RANDOM % 10 ) + 1 ]s
- VCN_NOTARIZATION_PASSWORD=$trv_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --silent immugw
- sleep $[ ( $RANDOM % 10 ) + 1 ]s
- VCN_NOTARIZATION_PASSWORD=$trv_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --silent immuadmin
- sleep $[ ( $RANDOM % 10 ) + 1 ]s
- VCN_NOTARIZATION_PASSWORD=$trv_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --silent immuclient
- /tmp/vcn logout
workspaces:
create:
name: bins
paths:
- immudb
- immuadmin
- immuclient
- immugw
- stage: Image
env:
- DOCKER_IMAGE="codenotary/immudb"
services:
- docker
workspaces:
use:
- bins
script:
- /tmp/vcn authenticate immudb immugw immuadmin immuclient
- VCN_USER=$immudb_user VCN_PASSWORD=$immudb_pass /tmp/vcn login
- docker build --tag "${DOCKER_IMAGE}:latest" -f Dockerfile .
- VCN_NOTARIZATION_PASSWORD=$immudb_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --silent docker://$DOCKER_IMAGE
- /tmp/vcn logout
- sleep $[ ( $RANDOM % 10 ) + 1 ]s
- VCN_USER=$trv_user VCN_PASSWORD=$trv_pass /tmp/vcn login
- VCN_NOTARIZATION_PASSWORD=$trv_pass /tmp/vcn n -p --attr TravisJobName=${TRAVIS_JOB_NAME} --attr TravisJobNo=${TRAVIS_JOB_NUMBER} --silent docker://$DOCKER_IMAGE
- /tmp/vcn logout
before_deploy:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
deploy:
provider: script
script: docker push "${DOCKER_IMAGE}:latest"
- stage: Coveralls
script:
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
- go get -u github.com/ory/go-acc
- set -o pipefail
- go-acc ./... --ignore test || true
- cat coverage.txt | grep -v "schema.pb" > cover.out
- $HOME/gopath/bin/goveralls -coverprofile=cover.out -service=travis-ci -repotoken $COVERALLS_TOKEN
- stage: Scan (edited)
branches:
only:
- master