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

@revolttv/revolt-deploy

v1.8.1

Published

Tool for deploying to Amazon Elastic Container Service.

Downloads

21

Readme

revolt-deploy

A deployment tool geared primarily for @RevoltTV's deployment process, but may be beneficial/extensible to other deployment patterns.

This tool performs the following primary tasks:

  1. Create a new Docker build with appropriate tags
  2. Push this new Docker build to Amazon Elastic Container Repository
  3. Create/Update an Elastic Container Service task with the new build
  4. Create/Update an Elastic Container Service service to redeploy with the new build
  5. Ensure the new services start correctly, and perform any cleanup of old resources

Installation

npm install -g @revolttv/revolt-deploy

Configuring

revolt-deploy can be configured in a few different ways:

  • environment variables
  • command line arguments
  • a revolt.yml file

It's recommended to use a revolt.yml file for most of the configuration, but anything that can be considered sensitive can be passed in via the command line or an environment variable

revolt.yml structure

The key common in the YAML file is used for shared configuration details that can be used for any deployment environment. It is recommended to use this for setting up the repository configuration at the very least

Additional top level keys refer to deployment environments which can be set with the DEPLOYMENT_ENV environment variable, or the --env command line argument

EXAMPLE

common:
    docker:
        buildArg: 'NPM_TOKEN=your-npm-token'
    repository:
        accountId: 'AWS_ACCOUNT_NUMBER'
        name: 'repository-name'
        region: 'aws-region-1'

production:
    cluster: 'name-of-cluster'
    loadBalancer:
        name: 'load-balancer'
        host: 'your-app.example.com'
        path: '/path/to/service'
        targetGroup:
            name: 'the-target-group'
            healthCheck:
                interval: 30
                path: '/health-check'
                port: 'traffic-port'
                timeout: 10
                healthyCount: 5
                unhealthyCount: 2
    regions:
        - 'aws-region-1'
        - 'aws-region-2'
    service:
        name: 'name-of-service'
        count: 2
        minimumPercent: 50
        maximumPercent: 200
        role: ecsServiceRole
    task:
        name: 'the-task-name'
        networkMode: 'bridge|host|none'
        container:
            name: 'the-container-name'
            cpu: 256
            memory: 512
            memoryReservation: 256
            ports:
                - 9999
                -
                    host: 9998
                    container: 9473
                    protocol: 'tcp|udp'
            environment:
                NODE_ENV: 'production'
                LOG_LEVEL: 'info'
            logs:
                driver: 'awslogs'
                options:
                    awslogs-group: 'service-logs-group'
                retention: 7

Token Replacement

The tool allows for a few token replacements which can be useful for dynamic naming. Tokens can be specified in the configuration value like so: name: service-version-${VERSION_MAJOR}, which will replace with name: service-version-1.

Tokens:

  • VERSION_MAJOR - major version from package.json version number
  • VERSION_MINOR - minor version from package.json version number
  • VERSION - full version number from package.json

AWS Configuration

revolt-deploy does not make any assumptions about how AWS is configured in the system. As such, any method listed in http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html should be sufficient.

It's recommended to use the Environmental Variable configuration method.

Deploying

Each deployment will create a Docker image and tag it with information from the project's package.json by default (package.name and package.version respectively). This can be overridden with environment variables DEPLOYMENT_NAME and DEPLOYMENT_TAG or command line arguments --name and --tag.

EXAMPLE

$: cd /your/project
$: DEPLOYMENT_ENV=production revolt-deploy --tag $CI_BUILD_NUMBER

Limitations

As of right now, revolt-deploy does not do the following:

  • Add EC2 instances to a new cluster
  • Attach an Elastic Load Balancer to a new service

These tasks will need to be completed manually at the moment, though this may change sometime in the future.