Coder Social home page Coder Social logo

ember-deploy-app's Introduction

Example Ember App for Deployment Automation (CI+CD)

This is a bare-bones Ember application, with only a handful of addons:

ember install ember-cli-deploy
ember install ember-cli-deploy-s3-pack
ember install ember-cli-deploy-cloudfront

This app is used as a reference by the Terraform project: https://github.com/psteininger/ember-deploy-aws

Configuration

There is one key difference from a vanilla Ember app with the 3 addons installed. the config/deploy.js has been altered and largely simplified. It can be simplified more, but that would make the setup a bit too rigid. Here is the configuration

module.exports = function(deployTarget) {
  var ENV = {
    //...
  };
  ENV.s3 = {};
  ENV["s3-index"] = {
    allowOverwrite: true
  };
  
  ENV.cloudfront = {
    accessKeyId: process.env.AWS_KEY,
    secretAccessKey: process.env.AWS_SECRET,
  };

  if (deployTarget === 'staging') {
    ENV.s3.accessKeyId = process.env.AWS_KEY;
    ENV.s3.secretAccessKey = process.env.AWS_SECRET;
    ENV.s3.bucket = process.env.ASSETS_STAGING_BUCKET;
    ENV.s3.region = process.env.AWS_REGION;
    ENV["s3-index"].accessKeyId = process.env.AWS_KEY;
    ENV["s3-index"].secretAccessKey = process.env.AWS_SECRET;
    ENV["s3-index"].bucket = process.env.INDEX_STAGING_BUCKET;
    ENV["s3-index"].region = process.env.AWS_REGION;
    ENV.cloudfront.distribution = process.env.CLOUDFRONT_DISTRIBUTION_ID_STAGING;
  }

  if (deployTarget === 'production') {
    ENV.s3.accessKeyId = process.env.AWS_KEY;
    ENV.s3.secretAccessKey = process.env.AWS_SECRET;
    ENV.s3.bucket = process.env.ASSETS_PRODUCTION_BUCKET;
    ENV.s3.region = process.env.AWS_REGION;
    ENV["s3-index"].accessKeyId = process.env.AWS_KEY;
    ENV["s3-index"].secretAccessKey = process.env.AWS_SECRET;
    ENV["s3-index"].bucket = process.env.INDEX_PRODUCTION_BUCKET;
    ENV["s3-index"].region = process.env.AWS_REGION;
    ENV.cloudfront.distribution = process.env.CLOUDFRONT_DISTRIBUTION_ID_PRODUCTION;
  }
  //...
};

Buildspec file

The root directory contains a buildspec.yml to be used by AWS CodeBuild. This file can be modified and enhanced, but for brevity, it includes only a deployment script.

version: 0.2

phases:
  install:
    commands:
      - printenv
      - npm install -g [email protected]
      - npm install
  build:
    commands:
      - ember deploy $EMBER_CLI_DEPLOY_TARGET

##Resources

##License The code in this repo is distributed under MIT License

ember-deploy-app's People

Contributors

ember-tomster avatar psteininger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.