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

@openaddresses/deploy

v8.0.2

Published

<h1 align="center">Deploy</h1>

Downloads

359

Readme

Brief

  • Store and manage AWS credentials locally for one or more AWS accounts
  • Create, Update, & Delete CF based stacks from the terminal

Install

Run the following

npm install -g @openaddresses/deploy

This will make the deploy command available globally

Auth Setup

Before you can make changes to any of the underlying infrastructure you must first authenticate the deploy cli

To do so run:

deploy init

and follow the prompts for your credentials.

Note the profile name prompted for should ideally match the profile name as set in your AWS credentials file located at ~/.aws/credentials If the profile name is found in your AWS credentials file, the credentials from the file will be linked. If it does not exist, you will be prompted for a set of credentials

Once finished run

deploy

to see a full list of options

Note: The credentials file can be found in the ~/.deployrc.json file

Global Config ~/.deployrc.json

Required Tags

If an account uses tags for billing, the following can be used in the ~/.deployrc.json file to ensure that tags are attached to all stacks deployed to that profile

| Key | Notes | | ----------------- | ----- | | region | Default AWS Account Region |

Optional Tags

| Key | Notes | | ----------------- | ----- | | tags | Cloudformation Tags to apply to stack | | github | Github API token for updating deployment status |

Tags

Tags can be added to all resources in a stack that is deployed. The tags array can contain either Keys as strings, or Key/Value objects.

Key as strings will be automatically populated for each resource of the CF template and the Value added as a Parameter of the stack

Key/Value objects will be automatically populated for each resource except that no Parameter will be added - the Value will be used directly

{
    "<profile_name>": {
        "region": "<region>",
        "tags": ["Project", {
            "Key": "Owner",
            "Value": "ingalls"
        }, "Client", "<another tag>"]
    }
}

Project Config ./deploy

Required Tags

If you run deploy init for a single AWS profile, all resources created with the tool will automatically be deployed to this "default" account.

If multiple AWS profiles are created via batch init, then you will either need to use the --profile <name> flag when interacting with the API, or to specify the profile in your .deploy file

The ./deploy file is created in the root directory of the git repo and follows the following format:

{
    "profile": "name of AWS Account profile",
}

Artifacts

Watching for Docker Artifacts

By default, if a Dockerfile is found in the project root, the ECR will be queried before deploy to ensure the image has been built. IE: a git repo named my-project would look for an image called my-project:<Git Sha>.

If you are building multiple docker images, or want to disable this feature, the following options are available via the .deploy file.

Disable ECR Check

{
    "artifacts": {
        "docker": false
    }
}

Custom Pre/Postfix

{
    "artifacts": {
        "docker": "custom-ecr:{{gitsha}}"
    }
}
{
    "artifacts": {
        "docker": "{{project}}:prefix-{{gitsha}}-postfix"
    }
}

Multiple Images

{
    "artifacts": {
        "docker": [
            "{{project}}:backend-{{gitsha}}",
            "{{project}}:frontend-{{gitsha}}"
        ]
    }
}

Watching for Docker Artifacts

Lambda uploads are not watched for by default. Set artifact listeners via your .deploy file using the examples below to ensure that they are present on s3 before deploy.

Disable Lambda Check (Default)

{
    "artifacts": {
        "lambda": false
    }
}

Single Lambda

{
    "artifacts": {
        "lambda": "<bucket>/{{gitsha}}.zip"
    }
}

Multiple Lambdas

{
    "artifacts": {
        "lambda": [
            "<bucket>/deploy-lambda/{{gitsha}}.zip",
            "<bucket:>/{{project}}-{{gitsha}}.zip"
        ]
    }
}

Tags

Tags can be added to all resources in a stack that is deployed. The tags array can contain either Keys as strings, or Key/Value objects.

The format to adding project specific tags is identical to profile tags as defined in the ~/.deployrc.json file. See this documentation for complete information on tag formatting.

{
    "tags": ["Project", {
        "Key": "Owner",
        "Value": "ingalls"
    }, "Client", "<another tag>"]
}