Created
March 14, 2016 04:04
-
-
Save sethbergman/4396fc3e5d8513dbe007 to your computer and use it in GitHub Desktop.
An opinionated collection of ember-cli-deploy plugins used to manage continuous deployment | https://github.com/zestyzesty/ember-cli-deploy-zesty-pack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* jshint node: true */ | |
| 'use strict'; | |
| function env(name) { | |
| if (process.env[name]) { | |
| return process.env[name]; | |
| } else { | |
| throw new Error('Expected environment variable `' + name + '` to be set but it was not.'); | |
| } | |
| } | |
| module.exports = function(deployTarget) { | |
| var ENV = { | |
| zesty: { | |
| publicURL: env('PUBLIC_URL') | |
| }, | |
| build: { | |
| environment: 'production' | |
| }, | |
| redis: { | |
| url: env('REDIS_URL'), | |
| allowOverwrite: true | |
| }, | |
| s3: { | |
| accessKeyId: env('S3_ACCESS_KEY_ID'), | |
| secretAccessKey: env('S3_SECRET_ACCESS_KEY'), | |
| region: undefined, | |
| bucket: undefined | |
| } | |
| }; | |
| if (deployTarget === 'production') { | |
| ENV.s3.region = env('PRODUCTION_REGION'); | |
| ENV.s3.bucket = env('PRODUCTION_BUCKET'); | |
| } else if (deployTarget === 'pull-request') { | |
| ENV.s3.region = env('PULL_REQUEST_REGION'); | |
| ENV.s3.bucket = env('PULL_REQUEST_BUCKET'); | |
| } else { | |
| throw new Error( | |
| "Invalid deploy target `" + deployTarget + "`. " + | |
| "Expected `production` or `pull-request`, e.g. " + | |
| "`ember deploy production`." | |
| ); | |
| } | |
| return ENV; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment