建立
-
创建一个
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