This repository has been archived by the owner on Feb 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgilbert.yaml
91 lines (82 loc) · 1.95 KB
/
gilbert.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
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
version: 1.0
imports:
- ./docs/common.yaml
plugins:
- go://./docs/actions
vars:
app_version: '1.0.0'
build_dir: '{{PROJECT}}/build'
lib_dir: '{{build_dir}}/lib'
server_dir: './server'
watcher_addr: 'localhost:4800'
mixins:
rebuild:
- task: build
- action: 'live-reload:trigger'
params:
address: '{{watcher_addr}}'
- task: start
tasks:
build:
- task: clean
- task: copy-assets
- task: build-libs
- description: build server
action: build
params:
source: '{{server_dir}}'
outputPath: '{{build_dir}}/server'
variables:
'main.version': '{{app_version}}'
'main.commit': '{% git log --format=%H -n 1 %}'
build-libs:
- mixin: build-lib
vars:
name: 'reddit'
- mixin: build-lib
vars:
name: 'stackexchange'
cover:
- action: cover
params:
threshold: 40
reportCoverage: true
packages:
- ./sources/...
watch:
- action: live-reload:start-server
async: true
params:
address: '{{watcher_addr}}'
timeout: 1500
- action: watch
params:
path: './server/...'
run:
mixin: rebuild
copy-assets:
- if: '[ ! -d {{build_dir}} ]'
description: 'create build directory'
action: shell
params:
command: 'mkdir {{build_dir}}'
- description: 'copy config file'
action: shell
params:
command: 'cp {{server_dir}}/config.json {{build_dir}}/config.json'
- description: 'copy assets'
action: shell
params:
command: 'cp -rf {{server_dir}}/public {{build_dir}}'
start:
- if: '[ -f {{build_dir}}/server ]'
action: shell
params:
command: '{{build_dir}}/server'
workDir: '{{build_dir}}'
clean:
- if: '[ -d {{ build_dir }} ]'
description: 'clean build directory'
action: shell
params:
command: 'rm -rf {{build_dir}}'