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
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:
-
Repository Initialization
- Clones the
blazity/next-enterprise-terraform
repository into the system's temporary directory
- Clones the
-
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)
- Presents an interactive terminal interface prompting for:
-
Branch Creation
- Generates a new branch named
enterprise-aws-setup-${timestamp}
using the UNIX Epoch Timestamp
- Generates a new branch named
-
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
- Copies essential files from the temporary clone to the current directory (local copy of
-
Code Modifications
- Applies various codemods including:
jscodeshift
for modifyingnext.config.ts
with additional properties (custom cache handler)hcl
for updating Terraform configuration with form-provided inputs
- Applies various codemods including:
-
GitHub Repository Creation
- Creates a new repository via GitHub API under the selected account/organization
-
Remote Configuration
- Links the local repository with the remote GitHub repository
-
AWS Configuration
- Displays interactive terminal interface requesting AWS-specific variables (including access keys)
-
Secret Management
- Sets repository secrets through GitHub API based on form information
-
Variable Configuration
- Sets repository variables via GitHub API (including universal
REDIS_URL
and others for CI/CD)
- Sets repository variables via GitHub API (including universal
-
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
-
Remote Synchronization
- Pushes all changes to the remote repository
-
Branch Reconciliation
- Performs synchronization (artificial merge) between the new remotely tracked
main
branch and localmain
- Deletes obsolete
enterprise-setup-${timestamp}
branches
- Performs synchronization (artificial merge) between the new remotely tracked