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

bluegreen

v0.0.1

Published

BlueGreen Deployment Automation for Docker containers

Downloads

4

Readme

bluegreen

BlueGreen deployments (starting with Docker on AWS). This is a highly opinionated framework for deploying Docker containers onto AWS.

Initially, we are targeting Elastic Beanstalk multi-container Docker deployments in an autoscale group. Furthermore, this is designed to target the Web Application profile in an autoscale group with accompanying Elastic Load Balancer.

The Blue-Green environments are swapped by adding/removing the Elastic Beanstalks ELB instance from a global ELB instance (representing the entry point of the application).

In the future, I'd like to migrate this to ECS. Keep in mind, this represents my current workflow and will mature when I change that workflow or find free time to expand it's functionality.

Model

Service: is a unit of management for an independent service-providing entity. Typically a single application, like a Node.js web server, but it can also be something like multiple Docker containers that are always deployed together. These are the core of what BlueGreen manages.

Version: each service has zero or more deployable Versions. A large part of the BlueGreen workflow is specifying what version should be deployed to a target Environment, and whether it should be accessible to a specific Gateway. The default implementation of versions is an Elastic Beanstalk Docker deployment as an Application Version. This implies two subphases of version creation:

  • Build: build a codebase. The default action is to build a Docker image.
  • Push: push the deployment artifacts to a remote repositories. The default action is to push a Docker image to a Docker repository.

Environments: where Versions of your Services get deployed. By default, we use blue and green, because conceptually, that's the whole point of this framework. However, we aren't so unimaginative that we don't realize you might also want to deploy to test or qa.

Gateways: these are where your customers (or other services) access your Services. In BlueGreen, this could simply be a CNAME swap in DNS, or the attaching of an Environment to a load balancer.

Modes of Operation

The BlueGreen toolchain can be used within the directory of a configured codebase or from any directory in your shell. This is similar to tools like Vagrant. Some commands are only designed to work within a codebase (like creating a new version), while the majority of commands can be operating from anywhere in a shell (like listing model constructs, or modifying entities from resources external to the local machine).

Usage

Using the Command Line

Overview commands

Help

bluegreen help

Get overall Statuses of services an environments

bluegreen ps

Service commands

List Services

bluegreen services

Create a new service

bluegreen create service <service>

bluegreen create service www

Teardown a service

bluegreen teardown service <service>

bluegreen teardown service www

Environment commands

List all environments (regardless of service)

bluegreen environments

List available Environments of a Service

bluegreen <service> environments

bluegreen www environments

Create an environment

bluegreen <service> create environment <environment>

bluegreen www create environment test

Teardown an Environment

bluegreen <service> teardown environment <environment>

bluegreen www teardown environment test

Version commands

List available Versions of a Service

bluegreen <service> versions

bluegreen www versions

Create a new Version of a Service

bluegreen <service> create version <version>

bluegreen www create version

bluegreen www create version 0.3.2

Deploy a Version of a Service to an Environment

bluegreen <service> deploy <version> to <environment>

bluegreen www deploy 0.3.2 to blue

Delete a Version of a Service

bluegreen <service> delete version <version>

bluegreen www delete version 0.3.1

Gateway commands

List all available Gateways

bluegreen gateways

List all available Gateways for a service

bluegreen <service> gateways

bluegreen www gateways

Create a Gateway (and attach to environment)

bluegreen <service> create gateway <name>
bluegreen www create gateway production

Teardown a Gateway

bluegreen <service> teardown gateway <name>

bluegreen www teardown gateway production

Swap the Gateways of two environments. If you are using CNAMEs as your Gateway, this will just switch blue to green's record, and vice versa.

bluegreen <service> swap [blue] [green]

bluegreen www swap blue green

Attach an environment to a Gateway. If the Gateway is something simple (like a CNAME), this may simply mean "detach the current environment, and use the new one". If it's a load balancer, it will attach both environments to the same load balancer (you might want this for a smoke test). If you want to detach the old environment and attach the new one, use swap.

bluegreen <service> attach <environment> to <gateway>

bluereen www attach blue to production

Detach an environment from a Gateway.

bluegreen <service> detach <environment> from <gateway>

bluegreen www detach blue from production

Debug Commands

bluegreen debug:create-version