sudo: required
language: node_js
branches:
  only:
  - develop
  - master
node_js:
- '0.12'
addons:
  apt:
    sources:
    - google-chrome
    packages:
    - google-chrome-stable
before_install:
- curl https://install.meteor.com | /bin/sh
- npm install -g npm@'>=2.13.5'
- mkdir -p node_modules
- npm install phantomjs
- npm install velocity-cli
- export PHANTOMJS_BIN=./node_modules/phantomjs/bin/phantomjs
- export JASMINE_BROWSER=PhantomJS
- export DEBUG=1
- export JASMINE_DEBUG=1
- export VELOCITY_DEBUG=1
- export VELOCITY_DEBUG_MIRROR=1
- export SANDSTORM_VERSION=$(curl -f "https://install.sandstorm.io/dev?from=0&type=install")
- cd /tmp
- curl https://dl.sandstorm.io/sandstorm-$SANDSTORM_VERSION.tar.xz | tar -xJf -
- export PATH=$PATH:${PWD}/sandstorm-$SANDSTORM_VERSION/bin
- sudo mkdir -p /home/vagrant
- sudo chown -R travis /home/vagrant
- sudo mkdir -p /opt
- sudo chown -R travis /opt
- cd $TRAVIS_BUILD_DIR
- cp -r . /opt/app
script:
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then echo "Building PR $TRAVIS_PULL_REQUEST"; meteor build ../build; exit $?; fi
- cd .travis
- npm install
- npm start
- cd ..
- meteor build ../build
- cd .travis
- sh ./namefiles.sh
- cd ..
- meteor add  rocketchat:livechat rocketchat:hubot
- meteor build --server demo.rocket.chat  ../build
- cd .travis
- sh ./namedemo.sh
- cd /tmp
- spk init -p3000 -- nothing
- export SANDSTORM_ID=$(grep '\sid =' sandstorm-pkgdef.capnp)
- cd $TRAVIS_BUILD_DIR/.sandstorm
- sed -i "s/\sid = .*/$SANDSTORM_ID/" sandstorm-pkgdef.capnp
- ./build.sh
- sed -i "s/\spgp/#pgp/g" sandstorm-pkgdef.capnp
- spk pack $TRAVIS_BUILD_DIR/rocket.chat.latest.spk
- cd $TRAVIS_BUILD_DIR
- mv rocket.chat.latest.spk ../build
after_deploy:
- cd .travis
- sh ./builddocker.sh
deploy:
  provider: s3
  access_key_id: "AKIAIKIA7H7D47KUHYCA"
  secret_access_key: $ACCESSKEY
  bucket: "rocketchatbuild"
  skip_cleanup: true
  local_dir: ../build
  on:
    branch:
    - develop
    - master
