Socket
Socket
Sign inDemoInstall

@danmasta/deploy

Package Overview
Dependencies
12
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @danmasta/deploy

Deployment tool for aws and docker


Version published
Weekly downloads
7
Maintainers
1
Install size
14.0 MB
Created
Weekly downloads
 

Readme

Source

Deploy

Easy deployment to AWS ECR repositories and Elastic Beanstalk environments using docker and aws cli

Features:

  • Easy to use
  • Build and tag docker images
  • Push docker images to private ECR registries
  • Deploy applications to elastic beanstalk environments
  • Interactive cmd line utility
  • Non-interactive mode for easy deployments from CI tools
  • Supports deployment to multiple AWS regions

About

We needed a better way to package and deploy apps. This package aims to make deployments to multiple elastic beanstalk apps and environments really simple. It can be used as a non-interactive cmd line utility, required and used programatically, or as an interactive cmd line prompt.

Usage

Install globally with npm

npm install -g @danmasta/deploy

Run the deploy script

deploy

For more usage info check out the examples

Options

Options can be passed via cmd line arguments, as an object if you require the package programatically, or stored with your other configuration if using a config package.

NameAliasTypeDesription
namenstringDocker image name
versionvstringWhat version to tag the docker image
ecrUriustringECR repository uri to push docker image to
regionrstring|arrayAWS region(s) to deploy to
ebstring|booleanIf true will trigger the elastic beanstalk deploy step
ebAppastringElastic Beanstalk application name
ebEnvestringElastic Beanstalk environment name
ebBucketbstringAWS s3 bucket name to push application zip to
dockerrundstringWhere is your projects dockerrun file located
outputDirostringWhere to save application zip before uploading
silentsstring|booleanIf false no output will be logged
interactiveistring|booleanIf true will trigger interactive mode
regionListstring|arrayList of AWS region(s) to show as selection options in interactive mode
helphbooleanShow help menu in console

It's really simple to store default deploy opts in config and just run deploy

Setup

Check out the wiki for some basic instructions to help get you started with docker and aws. These may not be exhaustive, but should be enough to get you headed in the right direction

Examples

Use config to set defaults

// ./config/default.js
module.exports = {
    deploy: {
        name: 'my-app',
        version: null,
        region: 'us-east-1',
        eb: true,
        ebApp: 'my-app',
        ebEnv: 'my-app-prod',
        ecrUri: '<ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com',
        ebBucket: 'elasticbeanstalk-<REGION>-<ACCOUNT_ID>',
        dockerrun: './Dockerrun.aws.json',
        outputDir: './dist/deploy',
        interactive: true,
        regionList: [
            'us-west-2',
            'us-east-1',
            'eu-west-1',
            'ap-northeast-1'
        ]
    }
};
// ./config/qa1.js
module.exports = {
    deploy: {
        ebEnv: 'my-app-qa1',
        regionList: [
            'us-east-1',
        ]
    }
};

Multiple Configs / Environments

Since this package uses the env and config pacakges, you can easily switch config values with cmd args. So if you have a config structure like this

./config/default.js
./config/production.js
./config/staging.js
./config/qa1.js
./config/qa2.js

You can then load deploy values for a specific environment by just running

deploy --env production --config qa1

Use non-interactive mode to deploy from your CI tool

deploy --eb -i false -v 2.1.5 -n app -a app -e app-prod -u ... -b ... -r us-east-1 -r ap-south-1

Require the package and run using gulp

const gulp = require('gulp');
const deploy = require('@danmasta/deploy');
const pkg = require('./package');

gulp.task('deploy', gulp.series('tests'), () => {

    return deploy({
        interactive: false,
        name: 'app',
        version: pkg.version,
        region: ['us-east-1'],
        eb: true,
        ebApp: 'app',
        ebEnv: 'app-prod',
        ecrUri: '...',
        ebBucket: '...'
    });

});

Dockerrun Examples

Check out the wiki for some examples on to configure your dockerrun files. I like to use the AWS multi-docker AMI for my environments, and then just configure one or more containers for each app

Contact

If you have any questions feel free to get in touch

Keywords

FAQs

Last updated on 12 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc