Skip to content
/ joy Public

The Jake and trOY devops-y utility

Notifications You must be signed in to change notification settings

tforster/joy

Repository files navigation

Joy CLI

The Jake and Troy devopsy utility.

Table of Contents

Prerequisites

The versions listed for these prerequisites are current at the time of writing. More recent versions will likely work but "your mileage may vary".

Setup and Configuration

  1. Clone the project

  2. Install dependencies

    npm install

    Note that the install process will also symlink the scripts in the src folder to your path making the CLI available from any project directory.

  3. Optionally build any of the Dockerised CLI images that will be used.

    1. GitHub: Build src/docker/gh.dockerfile as gh:latest to make the GitHub CLI available at joy gh. Note that the GitHub CLI is required if you wish to use joy git ticket with a GitHub repository.
    2. Azure DevOps: Build src/docker/az.dockerfile as az:latest to make the Azure DevOps CLI available at joy az. Note that the Azure DevOps CLI is required if you wish to use joy git ticket with an Azure DevOps hosted Git repository.

Usage

Joy can be thought of as a bash task runner that can launch scripts that are grouped together in families.

Github Flow

Starting with this release the Joy project will be switching to Github Flow for managing changes. Github Flow differs from some traditional Git flows in that it does not use a long running develop branch. Instead, every merge to main is considered deployable and should be deployed.

  1. Create a feature branch from main. To ensure consistency in naming convention use git joy ticket {ticket-number}.
  2. Push the feature branch upstream to origin
  3. Make code changes to the local feature branch, commit often and update the upstream branch often.
  4. When ready, create a Pull Request and request a review.
  5. Act on the Pull Request feedback, committing often.
  6. When the Pull request has been approved, deploy to production.
  7. If there is a failure, redeploy the current tip of the main branch to production and revisit the code in your local branch, restarting the process.
  8. Otherwise, complete the Pull Request to merge the code back to main, thus updating the tip of main.

How It Works

opinionated view on environment settings per project, get read from *.env, the passed to scripts.

Commands

Most commands are invoked directly from joy and a subcommand family. Some commands are available directly from Joy and in one command, cw, is available outside of Joy.

Prefix Family Command description
joy aws certificate-manager-new-cert Provision new ACM certificates
joy aws cloudfront-new-distribution Create a new CloudFront distribution
joy aws dynamodb-new-table Create a new DynamoDB table
joy aws route53-cloudfront-alias Alias a CloudFront distribution to a Route53 CNAME
joy aws route53-new-zone Create a new Route53 hosted zone
joy aws s3-new-web Create a new S3 bucket configured for static web hosting
joy git git-ticket Create a new branch based on the provided ticket number
joy wp deploy Deploy a WebProducer application to S3
joy wp wp-install Create a new empty WebProducer instance
joy wpe build-stack
joy wpe exportEnv
joy wpe setHomeSiteUrl
joy wpe sart-stack
joy wpe syncCodeToStage
joy wpe syncDataAndPluginsFromProdToDev
joy create-certs Create a new self-signed certificate
joy cw Manage working directory bookmarks
joy help Get help for the Joy CLI
joy info Get information about the current directroy
cw Change the current working directory to one previously bookmarked

Known Issues

Since the AWS CLI is now invoked from joy aws all the custom AWS scripts are blocked as their commands get passed the CLI and are invalid. This will be addressed in an upcoming release.

Change Log

See CHANGELOG.md