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

@greyshipscode/node_js_code_pipeline

v0.4.7

Published

A script to automate the creation of a complete Managed NodeJS SDLC Pipeline inside of AWS.

Downloads

7

Readme

NodeJSCodePipeline

cdk-version npm-version build-passing coverage-status npm-downloads

NodeJSCodePipeline is a CLI utility for quickly generating an automated NodeJS SDLC in AWS.

Features

  • Creates a NodeJS continuous delivery pipeline attached to a git repo with one command
  • Build, test and deploy new commits automatically
  • Includes manual approvals prior to automated production deploy
  • All resources are fully managed infrastructure-as-code backed by a CloudFormation Stack

Under Development

  • Automated integration test harness
  • Configurable email & sms updates

Getting Started

  1. Install this package via npm. npm install -g @greyshipscode/node_js_code_pipeline
  2. Ensure that your AWS Credentials are set in your environment.
  3. Run the first-time setup script. node_js_code_pipeline setup

Setting Your AWS Credentials

You may use the commands below to set your AWS credentials, replacing the values given with your id and secret.

Linux/MacOS

export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=us-west-2

Powershell

$Env:AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
$Env:AWS_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
$Env:AWS_DEFAULT_REGION="us-west-2"

Usage

You may run the script by running the following command in your preferred shell:

node_js_code_pipeline [command][-options]

Commands

Commands may be issued one at a time, and may be specified like: node_js_code_pipeline list

Stack Lifecycle Actions

  • Default: With no command (or an unrecognized command), this tool will attempt to deploy a new stack.
  • l or list: List the CDK stacks deployed to this aws account.
  • d or destroy: Attempt to destroy the stack specified via -n option. You will be asked for confirmation.

Other Commands

  • s or setup: Sets up the required resources for AWS's CDK in your AWS account.

Options

Options may be specified like so: node_js_code_pipeline -n TestSDLCStack

  • -n or --name: Sets the target stack name. If you are creating a stack, it will be named this.

Working With Your New Stack

:warning: DISCLAIMER! The deployment environments created by this script are not intended for production use.

This tool is intended to enable you to set up multiple continuous delivery pipelines for NodeJS as quickly as possible. BEFORE you deploy your app to production, you should customize the CloudFormation Template of your stack.

Pushing Your First Commit

Once your stack is created, you can trigger the pipeline by pushing your first commit to your primary branch. In order to deploy succesfully, your app needs just a few things:

  • Valid package.json including scripts: build & test
  • Valid appspec.yml and lifecycle scripts
  • The ability to reply to status checks at /status:80 with 200 OK

For convenience, I have developed a sample application with the absolute bare minimum to complete each stage of the pipeline successfully. To get started immediately, simply replace <GIT_REPO_URL> in the below shell script with the git URL for your new repository:

git clone https://github.com/greyshipscode/NodeJSCodePipeline-SampleApp.git
cd NodeJSCodePipeline-SampleApp
git remote set-url origin https://<GIT_REPO_URL>
git push -f

You will be asked to provide your git credentials.

For more information on AWS git credentials and CodeCommit, check out the official documentation.

Cleanup

To clean up all of the resources created by a stack, you just have to delete the underlying CloudFormation stack. For convenience, I have provided a wrapper around the CDK methods that provide this functionality. You may use the following commands:

List all stacks:

node_js_code_pipeline l or node_js_code_pipeline list

:warning: Please note that at the present time, all CDK stacks in the aws account will be displayed. A fix is under development.

Delete a stack by name:

node_js_code_pipeline d -n <STACK_NAME> or node_js_code_pipeline delete -n <STACK_NAME>