-
Notifications
You must be signed in to change notification settings - Fork 2
/
wercker.yml
47 lines (47 loc) · 1.5 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
box: ruby:2.5.1
build:
steps:
- bigtruedata/install-node
- bundle-install
# middleman build ブランチ名を環境変数として渡す
- script:
name: middleman build
code: bundle exec middleman build --verbose -e $WERCKER_GIT_BRANCH
# masterのデプロイ
deploy-production:
steps:
- add-to-known_hosts:
hostname: gtfs.jp
- mktemp:
envvar: PRIVATEKEY_PATH
# werckerで設定したsshの秘密鍵の環境変数を基に秘密鍵を生成
- create-file:
name: Create private key
filename: $PRIVATEKEY_PATH
content: $PRIVATE_KEY
overwrite: true
# scpでデプロイ
- script:
name: deploy testsite with scp
code: scp -i $PRIVATEKEY_PATH -r build/* [email protected]:/home/gtfs/www
# テストサイトのデプロイ
deploy-test-site:
steps:
- add-to-known_hosts:
hostname: gtfs.jp
- mktemp:
envvar: PRIVATEKEY_PATH
# werckerで設定したsshの秘密鍵の環境変数を基に秘密鍵を生成
- create-file:
name: Create private key
filename: $PRIVATEKEY_PATH
content: $PRIVATE_KEY
overwrite: true
# sshでアップ先ディレクトリを作成
- script:
name: ssh and mkdir
code: ssh -i $PRIVATEKEY_PATH [email protected] mkdir -p /home/gtfs/www/testsite/$WERCKER_GIT_BRANCH
# scpでデプロイ
- script:
name: deploy testsite with scp
code: scp -i $PRIVATEKEY_PATH -r build/* [email protected]:/home/gtfs/www/testsite/$WERCKER_GIT_BRANCH