Continuous Delivery
with Meteor

Sung Won Cho / @mikeswcho

Presented Jul 29 at Meteor Sydney

Why

  • Faster iteration
  • Less bandwidth

Overview

Local -> Git Repo -> CI server -> Production

Setup

  1. Build
  2. Deploy
  3. (Meteor Up)

1. Build the app

.travis.yml
sudo: required
language: node_js
node_js:
- '0.12'
before_install:
- curl https://install.meteor.com/ | sh
services: mongodb
script:
- meteor --test --release velocity:METEOR@1.1.0.2_3

tar cvf secrets.tar mup.json settings.json private_key
			# => secrets.tar
travis encrypt-file secrets.tar
			# => secrets.tar.enc

.travis.ymlbefore_install:
- curl https://install.meteor.com/ | sh
- npm install -g mup # Add this line to install mup

- openssl ... in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar # Add this line to decompress secrets.tar
.travis.ymlafter_success:
- deploy.sh
deploy.sh#!/bin/bash
echo "On branch '$TRAVIS_BRANCH'."

if [ "$TRAVIS_BRANCH" == "prod" ]; then
  echo "Triggering Mup deployment..."
  mup deploy
else
  echo "Not deploying. Use 'prod' branch to deploy."
fi  

End

- Demo
- Slides