From 6863b9e0d3ef4d10decf7a3ce6e7dd0b60c2903f Mon Sep 17 00:00:00 2001 From: Joost de Vries Date: Thu, 30 Jul 2015 18:20:59 +0200 Subject: [PATCH 1/2] Add deploy keys to travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 619d2712..7f5787bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ --- +AWS_ACCESS_KEY_ID: b1ugrISCMawg4LDOEnj91Eu3eb8EnxwOD63Y9owfxdaclmp/K4wOUdRXLE8Gmv0FXbzPJXbMld6a4wx0qfq95pQMy22gut0o4e9IAxPguhIeF9wFzZdw2nQFTEV2+T4Y52QIhPXnV403bt4hZZbIzfniwVRsdHoac60t9NoyBOI= +AWS_ACCESS_KEY_SECRET: X1tocl6D1nwzVtUjlR9n/PbtkhtgyGjmK0qUyL5DeTX8bY6pcIMZU3g5S1yoseMzV3DnjyoRrO1vZibFFRTPPa2iDVtMAjuVyKeQVhkMl++hslcF4QsO/qlFJJg2B2twlanKQDmiRG14dM032wyQcbHLQKVFW6yF6XoW4ZTUYBk= + language: node_js node_js: - "0.12" From a46656779d4dd2fcc90b4d75775de09e572479b3 Mon Sep 17 00:00:00 2001 From: Joost de Vries Date: Thu, 30 Jul 2015 19:51:49 +0200 Subject: [PATCH 2/2] Added deploy script --- .travis.yml | 1 - config/deploy.js | 4 ++-- ember-cli-build.js | 2 +- scripts/travis-deploy.sh | 17 +++++++++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 scripts/travis-deploy.sh diff --git a/.travis.yml b/.travis.yml index 7f5787bb..fdc0c9f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,6 @@ cache: - node_modules before_install: -# - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH - "npm config set spin false" - "npm install -g npm@^2" diff --git a/config/deploy.js b/config/deploy.js index 6e4c7aba..832ebb5a 100644 --- a/config/deploy.js +++ b/config/deploy.js @@ -7,14 +7,14 @@ module.exports = { type: "S3", accessKeyId: process.env['AWS_ACCESS_KEY_ID'], secretAccessKey: process.env['AWS_ACCESS_KEY_SECRET'], - bucket: "staging.ember-twiddle.com", + bucket: "canary.ember-twiddle.com", region: "us-west-2" }, assets: { type: "s3", accessKeyId: process.env['AWS_ACCESS_KEY_ID'], secretAccessKey: process.env['AWS_ACCESS_KEY_SECRET'], - bucket: "staging-assets.ember-twiddle.com", + bucket: "canary-assets.ember-twiddle.com", region: "us-west-2" } }, diff --git a/ember-cli-build.js b/ember-cli-build.js index 75fb7cce..652fd809 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -10,7 +10,7 @@ module.exports = function() { var prepend = null; if(isProductionLikeBuild) { - prepend = env==='production' ? '//assets.ember-twiddle.com/' : '//staging-assets.ember-twiddle.com/'; + prepend = env==='production' ? '//assets.ember-twiddle.com/' : '//canary-assets.ember-twiddle.com/'; } var blueprintsCode = getEmberCLIBlueprints(); diff --git a/scripts/travis-deploy.sh b/scripts/travis-deploy.sh new file mode 100644 index 00000000..8564310a --- /dev/null +++ b/scripts/travis-deploy.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Deploy to staging/production on master/release merges (not PRs) + +set -e + +# Don't deploy on PRs +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + exit 0 +fi + +if [ "$TRAVIS_BRANCH" == "master" ]; then + # Deploy to staging on a merge to master + ember deploy -e staging +elif [ "$TRAVIS_TAG" != "false" ]; then + # Deploy to production on a merge to release + ember deploy -e production +fi \ No newline at end of file