Travis-ci - deployment triggers

Reading time ~1 minute

Description

We need to deploy our Emberjs application when:

  • code is pushed/merged into deployment branch.
  • all acceptance tests succeed.

End Goal

before_deploy:
  - ember test -f 'Acceptance |'
deploy:
  skip_cleanup: true
  provider: script
  script: ember deploy testing --verbose
  on:
    branch: deployment

Step by step

  • Setup deployment trigger
deploy:
  on:
    branch: deployment
  • Run the acceptance tests
before_deploy:
  - ember test -s -f 'Acceptance |'
  • Add the deployment command
deploy:
  provider: script
  script: ember deploy testing --verbose
  • Complete travis config file
---
language: node_js
node_js:
  - "4.5.0"

sudo: false

cache:
  directories:
    - node_modules

before_install:
  - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
  - "npm config set spin false"
  - "npm install -g npm@^2"

install:
  - npm install -g bower
  - npm install
  - bower install

script:
  - npm test

before_deploy:
  - ember test -s -f 'Acceptance |'
deploy:
  skip_cleanup: true
  provider: script
  script: ember deploy testing --verbose
  on:
    branch: deployment

Now you can do this!

GitHub resources:

App Deployment - Serve Emberjs app on s3

Deploy Emberjs app on s3 and allow access to all routes using the hash Continue reading

App Deployment - deploy different index files

Published on October 11, 2016

Travis-ci - Send notification with custom message

Published on September 29, 2016