npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@danmasta/deploy

v1.0.0

Published

Deployment tool for aws and docker

Downloads

7

Readme

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.

Name | Alias | Type | Desription -----|------ |------|----------- name | n | string | Docker image name version | v | string | What version to tag the docker image ecrUri | u | string | ECR repository uri to push docker image to region | r | string|array | AWS region(s) to deploy to eb | | string|boolean | If true will trigger the elastic beanstalk deploy step ebApp | a | string | Elastic Beanstalk application name ebEnv | e | string | Elastic Beanstalk environment name ebBucket | b | string | AWS s3 bucket name to push application zip to dockerrun | d | string | Where is your projects dockerrun file located outputDir | o | string | Where to save application zip before uploading silent | s | string|boolean | If false no output will be logged interactive | i | string|boolean | If true will trigger interactive mode regionList | | string|array | List of AWS region(s) to show as selection options in interactive mode help | h | boolean | Show 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