-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwercker.yml
104 lines (92 loc) · 2.93 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
#
# @note please define 'Application environment variables' or 'Pipeline environment variables' on werkcer
#
# @env AWS_ACCESS_KEY_ID ***
# @env AWS_SECRET_ACCESS_KEY ***
# @env AWS_S3_BUCKET s3://tarumae-assets/viewer/
# @env SLACK_SUBDOMAIN autofloor
# @env SLACK_TOKEN ***
# @env SLACK_CHANNEL #notifications
# @env DEPLOY_URL_BASE https://s3-ap-northeast-1.amazonaws.com/tarumae-assets/viewer/
#
box: node:8.9.4
test:
steps:
- script:
name: echo nodejs information
code: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"
- script:
name: install
code: |
npm install
- script:
name: test
code: |
npm run test
build:
steps:
- script:
name: echo nodejs information
code: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"
- script:
name: install
code: |
rm -rf node_modules
npm install
- script:
name: build
code: |
npm run pub
ls -al ./dist/
deploy:
steps:
- script:
name: echo nodejs information
code: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"
- script:
name: install
code: |
rm -rf node_modules
npm install
- script:
name: build
code: |
build/pack
- script:
name: version
code: |
export PACKAGE_VERSION=`node build/version.js`
export DEPLOY_DIR=$([ $WERCKER_GIT_BRANCH = "master" ] && echo `node build/version.js --minor` || echo $WERCKER_GIT_BRANCH)
export AWS_S3_BUCKET_VERSION=$AWS_S3_BUCKET$DEPLOY_DIR'/'
# export PACKAGE_LATEST='latest'
- s3sync:
key-id: $AWS_ACCESS_KEY_ID
key_secret: $AWS_SECRET_ACCESS_KEY
bucket-url: $AWS_S3_BUCKET_VERSION
source-dir: dist/
delete-removed: false
#opts: --acl-private
after-steps:
- script:
name: version
code: |
export PACKAGE_VERSION=`node build/version.js`
export DEPLOY_DIR=$([ $WERCKER_GIT_BRANCH = "master" ] && echo `node build/version.js --minor` || echo $WERCKER_GIT_BRANCH)
export AWS_S3_BUCKET_VERSION=$AWS_S3_BUCKET$DEPLOY_DIR'/'
# export PACKAGE_LATEST='latest'
- sherzberg/slack-notify:
subdomain: $SLACK_SUBDOMAIN
token: $SLACK_TOKEN
channel: $SLACK_CHANNEL
username: "Deployer"
icon_emoji: ":robot_face:"
passed_message: "*Wercker App* : <$WERCKER_APPLICATION_URL|$WERCKER_APPLICATION_OWNER_NAME/$WERCKER_APPLICATION_NAME>\n
*Branch* : <https://github.com/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY/tree/$WERCKER_GIT_BRANCH|$WERCKER_GIT_BRANCH>\n
*Pushed by* : $WERCKER_STARTED_BY\n
*Deployed to*: <$DEPLOY_URL_BASE$DEPLOY_DIR/tarumae-$PACKAGE_VERSION.tgz|/$DEPLOY_DIR/tarumae-$PACKAGE_VERSION.tgz>"