forked from weseek/growi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
158 lines (127 loc) · 3.33 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
box: node:6.11
services:
- mongo:3.4
test:
steps:
- script:
name: set yarn cache-folder
code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
- script:
name: install dependencies
code: |
yarn global add npm@4
yarn install
- script:
name: print dependencies
code: yarn list --depth=0
- script:
name: npm test
code: |
export MONGO_URI=mongodb://$MONGO_PORT_27017_TCP_ADDR/crowi_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 dependencies
code: |
yarn global add npm@4
yarn install --production
- script:
name: install plugins
code: |
yarn add crowi-plugin-lsx
yarn add crowi-plugin-pukiwiki-like-linker
- script:
name: print dependencies
code: yarn list --depth=0
- script:
name: npm run build:prod:analyze
code: |
npm run build:prod:analyze
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 dependencies
code: |
yarn global add npm@4
yarn install
- script:
name: install plugins
code: |
yarn add crowi-plugin-lsx
yarn add crowi-plugin-pukiwiki-like-linker
- script:
name: print dependencies
code: yarn list --depth=0
- 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
# get version
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
TARGET_COMMITISH=`git rev-parse HEAD`
- github-create-release:
token: $GITHUB_TOKEN
tag: v$RELEASE_VERSION
target-commitish: $TARGET_COMMITISH
- script:
name: remove temporary release branch
code: |
git push --delete origin $TMP_RELEASE_BRANCH
- script:
name: trigger crowi-plus-docker release pipeline
code: sh ./bin/wercker/trigger-crowi-plus-docker.sh
after-steps:
- slack-notifier:
url: $SLACK_WEBHOOK_URL
channel: ci
username: wercker
notify_on: "failed"