forked from weseek/growi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwercker.yml
182 lines (146 loc) · 4.12 KB
/
wercker.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
box: node:10
services:
- mongo:3.6
test:
steps:
- script:
name: set yarn cache-folder
code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
- script:
name: install dependencies
code: |
yarn
- script:
name: print dependencies
code: |
echo -n "node " && node -v
echo -n "npm " && npm -v
yarn list --depth=0
- script:
name: npm run lint
code: |
npm run lint
- script:
name: npm test
code: |
export MONGO_URI=mongodb://$MONGO_PORT_27017_TCP_ADDR/growi_test
echo "export MONGO_URI=$MONGO_URI"
npm test
after-steps:
- slack-notifier:
url: $SLACK_WEBHOOK_URL
channel: ci
username: wercker
notify_on: "failed"
build-prod:
steps:
- script:
name: set yarn cache-folder
code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
- script:
name: install plugins
code: |
yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker
- script:
name: npm run build:prod:analyze
code: |
npm run build:prod:analyze
- script:
name: npm run server:prod:ci
code: |
export MONGO_URI=mongodb://$MONGO_PORT_27017_TCP_ADDR/growi
echo "export MONGO_URI=$MONGO_URI"
npm run server:prod:ci
after-steps:
- script:
name: copy report to artifacts
code: |
cp -r report $WERCKER_REPORT_ARTIFACTS_DIR
- slack-notifier:
url: $SLACK_WEBHOOK_URL
channel: ci
username: wercker
notify_on: "failed"
build-dev:
steps:
- script:
name: set yarn cache-folder
code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
- script:
name: install plugins
code: |
yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker
- script:
name: npm run build:dev
code: |
npm run build:dev
after-steps:
- slack-notifier:
url: $SLACK_WEBHOOK_URL
channel: ci
username: wercker
notify_on: "failed"
release: # would be run on release branch
steps:
- install-packages:
packages: jq
- script:
name: bump version
code: |
sh ./bin/wercker/init-git.sh
# git reset
git reset --hard
# npm version to bump version
npm version patch
- script:
name: get RELEASE_VERSION
code: |
export RELEASE_VERSION=`npm run version --silent`
echo "export RELEASE_VERSION=$RELEASE_VERSION"
- script:
name: commit and push
code: |
TMP_RELEASE_BRANCH=tmp/release-$RELEASE_VERSION
git checkout -B $TMP_RELEASE_BRANCH
git push -u origin HEAD:$TMP_RELEASE_BRANCH
export RELEASE_GIT_COMMIT=`git rev-parse HEAD`
- github-create-release:
token: $GITHUB_TOKEN
tag: v$RELEASE_VERSION
target-commitish: $RELEASE_GIT_COMMIT
- script:
name: remove temporary release branch
code: |
git push --delete origin $TMP_RELEASE_BRANCH
- script:
name: trigger growi-docker release pipeline
code: GROWI_DOCKER_PIPELINE_ID=$GROWI_DOCKER_PIPELINE_ID_CDN sh ./bin/wercker/trigger-growi-docker.sh
- script:
name: trigger growi-docker release-nocdn pipeline
code: GROWI_DOCKER_PIPELINE_ID=$GROWI_DOCKER_PIPELINE_ID_NOCDN sh ./bin/wercker/trigger-growi-docker.sh
after-steps:
- slack-notifier:
url: $SLACK_WEBHOOK_URL
channel: ci
username: wercker
notify_on: "failed"
release-rc: # would be run on rc/* branches
steps:
- install-packages:
packages: jq
- script:
name: get RELEASE_VERSION
code: |
export RELEASE_VERSION=`npm run version --silent`
export RELEASE_GIT_COMMIT=$WERCKER_GIT_COMMIT
echo "export RELEASE_VERSION=$RELEASE_VERSION"
echo "export RELEASE_GIT_COMMIT=$RELEASE_GIT_COMMIT"
- script:
name: trigger growi-docker release-rc pipeline
code: sh ./bin/wercker/trigger-growi-docker.sh
after-steps:
- slack-notifier:
url: $SLACK_WEBHOOK_URL
channel: ci
username: wercker
notify_on: "failed"