-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathlain.yaml
61 lines (56 loc) · 1.92 KB
/
lain.yaml
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
appname: entry
build:
base: golang:1.10
prepare:
script:
- go get -u -v github.com/golang/dep/cmd/dep
- cp -f /go/bin/dep /usr/local/bin/
- sed -i 's|deb.debian.org|mirrors.ustc.edu.cn|g' /etc/apt/sources.list
- sed -i 's|security.debian.org|mirrors.ustc.edu.cn|g' /etc/apt/sources.list
- curl -sL https://deb.nodesource.com/setup_9.x | bash -
- apt-get -y update && apt-get -y install apt-transport-https ca-certificates nodejs
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt-get -y update && apt-get -y install yarn
script:
- mkdir -p /go/src/github.com/laincloud/entry
- cp -rf server /go/src/github.com/laincloud/entry/
- go install -v github.com/laincloud/entry/server/gen/cmd/entry-server
- npm config set registry https://registry.npm.taobao.org
- cd frontend/ && yarn install
- cd frontend/ && yarn build
test:
script:
- go test github.com/laincloud/entry/server/...
release:
dest_base: laincloud/nginx:1.13
copy:
- src: /go/bin/entry-server
dest: /lain/app/entry-server
- src: nginx.conf
dest: /etc/nginx/conf.d/default.conf
- src: frontend/build
dest: /usr/share/nginx/html
web: # backend
cmd: /lain/app/entry-server --config=/lain/app/prod.json --host=0.0.0.0 --port=80
port: 80
healthcheck: /api/ping
memory: 256M
env:
- LAINLET_PORT=9000
- SWARM_PORT=2376
secret_files:
- /lain/app/prod.json
cloud_volumes:
type: single
dirs:
- /cloud
proc.frontend:
type: web
cmd: nginx -g "daemon off;"
port: 80
healthcheck: /ping
mountpoint:
- /web
https_only: true
memory: 32M