-
Notifications
You must be signed in to change notification settings - Fork 23
/
.evg.yml
211 lines (202 loc) · 7.46 KB
/
.evg.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
cloud_dependent_pkg: &cloud_dependent_pkg "commands"
functions:
"setup_project":
- command: shell.exec
params:
script: |
mkdir -p src/github.com/10gen
- command: git.get_project
params:
directory: src/github.com/10gen/stitch-cli
"setup_mongod":
- command: shell.exec
params:
script: |
set -v
curl --silent ${mongodb_url} | tar xvz
- command: shell.exec
params:
background: true
script: |
set -v
cd mongodb-*
echo "starting mongod..."
mkdir db_files
./bin/mongod --dbpath ./db_files --port 26000 &
echo "waiting for mongod to start up"
- command: shell.exec
params:
script: |
set -e
cd mongodb-*
echo "waiting for mongod to start up"
./bin/mongo --nodb --eval 'assert.soon(function(x){try{var d = new Mongo("localhost:26000"); return true}catch(e){return false}}, "timed out connecting")'
echo "mongod is up."
"setup_stitch_server":
- command: shell.exec
params:
script: |
wget --quiet "${libmongo_url}"
chmod +x libmongo.so
- command: shell.exec
params:
script: |
mkdir -p src/github.com/10gen
- command: shell.exec
params:
script: |
mkdir -p server/src/github.com/10gen
git clone git@github.com:10gen/stitch.git server/src/github.com/10gen/stitch
- command: shell.exec
params:
script: |
set -e
cd server/src/github.com/10gen/stitch/etc/transpiler
yarn install && yarn run build -t ${transpiler_target}
"start_server":
- command: shell.exec
params:
background: true
script: |
export PATH="`pwd`:$PATH"
cd server
export GOPATH=`pwd`
cd $GOPATH/src/github.com/10gen/stitch
export PATH="$GOPATH/src/github.com/10gen/stitch/etc/transpiler/bin:$PATH"
which transpiler
go run cmd/server/main.go --configFile $GOPATH/../src/github.com/10gen/stitch-cli/testdata/configs/stitch_server_test_config.json
- command: shell.exec
params:
script: |
counter=0
until $(curl --output /dev/null --silent --head --fail ${stitchServerURL}); do
echo "checking for API server to be up..."
sleep 1
let counter++
if [ $counter -gt 100 ]; then
exit 1
fi
done
tasks:
- name: test_unit
exec_timeout_secs: 3600
commands:
- func: "setup_project"
- command: shell.exec
params:
script: |
set -v
set -e
export GOPATH=`pwd`
export PATH="`pwd`:$PATH"
go test -v $(go list github.com/10gen/stitch-cli/...) > $GOPATH/stitch-cli.suite
- name: tests-with-cloud
exec_timeout_secs: 3600
commands:
- func: "setup_project"
- func: "setup_mongod"
- func: "setup_stitch_server"
- func: "start_server"
- command: shell.exec
params:
script: |
set -v
set -e
export GOPATH=`pwd`
export PATH="`pwd`:$PATH"
export STITCH_MONGODB_CLOUD_GROUP_ID="${stitch_mongodb_cloud_group_id}"
export STITCH_MONGODB_CLOUD_USERNAME="${stitch_mongodb_cloud_username}"
export STITCH_MONGODB_CLOUD_API_KEY="${stitch_mongodb_cloud_api_key}"
export STITCH_MONGODB_CLOUD_API_BASE_URL="${mongoDBCloudURL}"
export STITCH_SERVER_BASE_URL="${stitchServerURL}"
go test -v $(go list github.com/10gen/stitch-cli/${cloud_dependent_pkg}/...) -timeout 25m -run TestCloud > $GOPATH/stitch-cli.suite
- name: gometalinter
commands:
- func: "setup_project"
- command: shell.exec
params:
script: |
export GOPATH=`pwd`
go get -u github.com/alecthomas/gometalinter
$GOPATH/bin/gometalinter --install
cd src/github.com/10gen/stitch-cli
$GOPATH/bin/gometalinter --exclude=vendor --vendor --config=.linter.config ./...
- name: build_publish_clis
depends_on:
- name: test_unit
- name: gometalinter
patchable: false
commands:
- func: "setup_project"
- command: shell.exec
params:
script: |
set -v
set -e
export GOPATH=`pwd`
export PATH="`pwd`:$PATH"
cd src/github.com/10gen/stitch-cli
export VERSION=20180625
export GOARCH=amd64
export GOOS=linux
export OSARCH=linux-amd64
echo "Building stitch-cli for $GOOS on $GOARCH"
REPLACE_VARS="-ldflags \"-X github.com/10gen/stitch-cli/utils.cliVersion=$VERSION -X github.com/10gen/stitch-cli/utils.cliOSArch=$OSARCH\""
eval go build $REPLACE_VARS -o stitch-cli-linux-amd64 main.go
export GOOS=darwin
export OSARCH=macos-amd64
REPLACE_VARS="-ldflags \"-X github.com/10gen/stitch-cli/utils.cliVersion=$VERSION -X github.com/10gen/stitch-cli/utils.cliOSArch=$OSARCH\""
echo "Building stitch-cli for $GOOS on $GOARCH"
eval go build $REPLACE_VARS -o stitch-cli-macos-amd64 main.go
export GOOS=windows
export OSARCH=windows-amd64
REPLACE_VARS="-ldflags \"-X github.com/10gen/stitch-cli/utils.cliVersion=$VERSION -X github.com/10gen/stitch-cli/utils.cliOSArch=$OSARCH\""
echo "Building stitch-cli for $GOOS on $GOARCH"
eval go build $REPLACE_VARS -o stitch-cli-windows-amd64 main.go
- command: s3.put
params:
aws_key: ${artifacts_aws_key}
aws_secret: ${artifacts_aws_secret}
local_file: src/github.com/10gen/stitch-cli/stitch-cli-linux-amd64
remote_file: ${build_id}/linux-amd64/stitch-cli
bucket: stitch-clis
content_type: application/octet-stream
permissions: public-read
- command: s3.put
params:
aws_key: ${artifacts_aws_key}
aws_secret: ${artifacts_aws_secret}
local_file: src/github.com/10gen/stitch-cli/stitch-cli-macos-amd64
remote_file: ${build_id}/macos-amd64/stitch-cli
bucket: stitch-clis
content_type: application/octet-stream
permissions: public-read
- command: s3.put
params:
aws_key: ${artifacts_aws_key}
aws_secret: ${artifacts_aws_secret}
local_file: src/github.com/10gen/stitch-cli/stitch-cli-windows-amd64
remote_file: ${build_id}/windows-amd64/stitch-cli.exe
bucket: stitch-clis
content_type: application/octet-stream
permissions: public-read
post:
- command: gotest.parse_files
params:
files: ["*.suite"]
buildvariants:
- name: linux-64
display_name: Linux-64
run_on:
- baas-linux
expansions:
transpiler_target: node8-linux
mongodb_url: https://downloads.mongodb.com/linux/mongodb-linux-x86_64-enterprise-rhel70-3.4.6.tgz
libmongo_url: https://s3.amazonaws.com/stitch-artifacts/stitch-mongo-libs/stitch_mongo_libs_linux_64_patch_1f02b06ec6fd48bad0b725b77bc194c84f839f53_5ab7216fc9ec44724e08f194_18_03_25_04_11_28/libmongo.so
mongoDBCloudURL: https://cloud-dev.mongodb.com
stitchServerURL: http://localhost:9090
tasks:
- name: test_unit
- name: tests-with-cloud
- name: gometalinter
- name: build_publish_clis