Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add travis deploy #101

Merged
merged 2 commits into from
Jul 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
AWS_ACCESS_KEY_ID: b1ugrISCMawg4LDOEnj91Eu3eb8EnxwOD63Y9owfxdaclmp/K4wOUdRXLE8Gmv0FXbzPJXbMld6a4wx0qfq95pQMy22gut0o4e9IAxPguhIeF9wFzZdw2nQFTEV2+T4Y52QIhPXnV403bt4hZZbIzfniwVRsdHoac60t9NoyBOI=
AWS_ACCESS_KEY_SECRET: X1tocl6D1nwzVtUjlR9n/PbtkhtgyGjmK0qUyL5DeTX8bY6pcIMZU3g5S1yoseMzV3DnjyoRrO1vZibFFRTPPa2iDVtMAjuVyKeQVhkMl++hslcF4QsO/qlFJJg2B2twlanKQDmiRG14dM032wyQcbHLQKVFW6yF6XoW4ZTUYBk=

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO NOT COMMIT YOUR KEYS

CHANGE THEM NOW

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These types of keys are typically encrypted when commited to the .travis.yml, which may be the case here (they are not generally this long when unencrypted).

@joostdevries can confirm (or fix 💃)...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very 🔒. no worries.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aka encrypted using travis public key

language: node_js
node_js:
- "0.12"
Expand All @@ -17,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"

Expand Down
4 changes: 2 additions & 2 deletions config/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
17 changes: 17 additions & 0 deletions scripts/travis-deploy.sh
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the order might need to be swapped here (check for the tag first, then master). I can't recall off the top of my head what the branch is for tag builds...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, apparently TRAVIS_BRANCH is not set on the build running for a tag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that a "+1" :trollface:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is good, no need to tweak.

# Deploy to production on a merge to release
ember deploy -e production
fi