建立
-
建立一個
deployment_token.json
:METEOR_SESSION_FILE=deployment_token.json meteor login
-
在 Codeship 上建立以下環境變數:( https://codeship.com/projects/PROJECT_NUMBER/configure_environment)
- METEOR_TARGET:your.domain.com
- METEOR_TOKEN:複製/貼上 deployment_token.json 的內容。像:
{"sessions": {"www.meteor.com": {"session": "12345 ...
- METEOR_SETTING:複製/貼上 settings.json 的內容。像:
{"private": {...
-
在此處建立新的部署管道 https://codeship.com/projects/YOUR_PROJECT_NUMBER/deployment_branches/new
- 我們只部署主分支。所以設定:分支完全是:master。
-
使用以下內容新增自定義指令碼作為部署:
echo $METEOR_TOKEN > deployment_token.json
echo $METEOR_SETTINGS > deployment_settings.json
meteor npm prune --production
DEPLOY_HOSTNAME=galaxy.meteor.com METEOR_SESSION_FILE=deployment_token.json meteor deploy $METEOR_TARGET --settings deployment_settings.json