We've released the Enterprise CLI for seamless deployments of Next.js projects on the AWS with complete IaC (Terraform) setup. Learn more
Blazity Logo
Deployments

Enterprise CLI

Learn more about the Enterprise CLI, an state-of-the art Next.js deployments assistant for various cloud providers

Introduction

Enterprise CLI is a fully open source command-line tool created in Golang with goal to simplify setting up and deploying infrastructure across cloud providers by automating the processes that would require cumbersome manual work.

Installation

With security and transparency in mind the CLI compiles locally on your machine rather than using pre-built binaries from registries

Execute the installation script

Paste this in your terminal

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/Blazity/enterprise-cli/main/install.sh | sh

Check if the CLI is working

enterprise --help

This should show following output:

Enterprise CLI for infrastructure management

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  prepare     Prepare infrastructure for enterprise deployment

Use "enterprise [command] --help" for more information about a command.

Next steps

Continue reading about available providers and how to get started with each one.

Supported Providers

How does it work?

The Enterprise CLI provides automation for processes that can be performed manually. Let's assume you are using the aws provider, the CLI executes the following sequence of operations:

  1. Repository Initialization

    • Clones the blazity/next-enterprise-terraform repository into the system's temporary directory
  2. Configuration Collection

    • Presents an interactive terminal interface prompting for:
      • AWS Bucket name (for terraform state)
      • AWS Project name
      • AWS Region (deployment target)
      • Repository name (for the new repository)
      • Repository owner (user/organization under which the repository will be created)
      • Visibility settings (public or private repository)
  3. Branch Creation

    • Generates a new branch named enterprise-aws-setup-${timestamp} using the UNIX Epoch Timestamp
  4. File Transfer

    • Copies essential files from the temporary clone to the current directory (local copy of blazity/next-enterprise):
      • terraform/ directory
      • .github/workflows (CI/CD configurations)
      • docker-compose.yml
      • Dockerfile
      • .npmrc
  5. Code Modifications

    • Applies various codemods including:
      • jscodeshift for modifying next.config.ts with additional properties (custom cache handler)
      • hcl for updating Terraform configuration with form-provided inputs
  6. GitHub Repository Creation

    • Creates a new repository via GitHub API under the selected account/organization
  7. Remote Configuration

    • Links the local repository with the remote GitHub repository
  8. AWS Configuration

    • Displays interactive terminal interface requesting AWS-specific variables (including access keys)
  9. Secret Management

    • Sets repository secrets through GitHub API based on form information
  10. Variable Configuration

    • Sets repository variables via GitHub API (including universal REDIS_URL and others for CI/CD)
  11. Actions Enablement

    • Enables actions/workflows through GitHub API for the newly created repository NOTE: This may take up to couple minutes to activate after the programatic repository creation
  12. Remote Synchronization

    • Pushes all changes to the remote repository
  13. Branch Reconciliation

    • Performs synchronization (artificial merge) between the new remotely tracked main branch and local main
    • Deletes obsolete enterprise-setup-${timestamp} branches

On this page