/cometaws

[VERY] opinionated AWS interface used in Comet Lab projects

Primary LanguageJavaScript

CometAWS

Build Status Dependencies Status

Extremely Opinionated Amazon Web Services interface with deployment using shipit

Quick Start

Install Dependencies

  • Install Node.js
  • Install Gulp if you intend to develop/contribute to this project

Install cometaws

  • cometaws should be installed locally to your projects so your shipitfile.js follows the versioning of the cometaws package.
sudo npm install --save cometaws

Configure cometaws

  • CometAWS requires you to already have AWS configuration files in place from the aws-sdk npm package
  • See shipit for configuration and interface for defining/running tasks

Create a new shipitfile.js with the following content:

module.exports = function (shipit, tasks, cometDeployer) {
    // defines matching EC2 servers based on tags
    cometDeployer.tags = [{
        Key: 'Role',
        Value: 'cl-web'
    }];

    // use public DNS when using script outside AWS
    cometDeployer.usePrivateDns = false;

    // shipit config
    var config = {
        default: {
            workspace: '/tmp/my_project_example',
            repositoryUrl: 'git@github.com:example/example.git',
            ignores: ['.git', 'node_modules'],
            keepReleases: 4,
            deleteOnRollback: false,
            shallowClone: true
        },
        development: {
            branch: 'develop'
        },
        production: {
            branch: 'master'
        }
    };

    return cometDeployer.configureShipit(shipit, config).then( config => {
        // dynamic list of `config.servers` is now available and we can define shipit tasks
    });

Running shipitfile

Use ./bin/cometshipit to launch a shipit instance bootstrapped with CometDeployer which is not initialized until cometDeployer.configureShipit(shipit, config) is completed.

License

Copyright 2015 Comet Lab AS.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.