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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@john.klaumann/devops-deploy-cli

v1.1.0

Published

CLI tool to generate Dockerfile, Terraform and deployment scripts for .NET microservices

Downloads

5

Readme

DevOps Deploy CLI

A CLI tool to automate the generation of deployment files for .NET microservices, eliminating dependency on DevOps team for basic deployment tasks.

🚀 Features

  • Automatic Dockerfile: Generates optimized Dockerfile based on your .NET project
  • Complete Terraform: Creates full configuration for AWS ECR + Kubernetes
  • Deploy scripts: Ready-to-use bash scripts for AWS deployment
  • Auto-discovery: Automatically finds .sln and launchSettings.json files
  • Multi-environment: Support for dev, staging and production

📦 Installation

Option 1: Global Installation (Recommended)

npm install -g @john.klaumann/devops-deploy-cli

Option 2: Use with npx (No installation)

npx @john.klaumann/devops-deploy-cli generate --all

Option 3: Install in Project

npm install @john.klaumann/devops-deploy-cli --save-dev

🛠️ Basic Usage

1. Generate all deployment files

# In your .NET project directory
devops-deploy generate --all

This will generate:

  • Dockerfile
  • main.tf, variables.tf, outputs.tf
  • terraform.tfvars.example
  • deploy.sh, quick-deploy.sh, rollback.sh, status.sh
  • README.md with instructions

2. Generate only Dockerfile

devops-deploy generate --docker

3. Generate only Terraform files

devops-deploy generate --terraform

4. Generate only deployment scripts

devops-deploy generate --deploy

🎯 Available Commands

generate

Generates deployment files based on your .NET project.

devops-deploy generate [options]

Options:

  • --docker: Generate only Dockerfile
  • --terraform: Generate only Terraform files
  • --deploy: Generate only deployment scripts
  • --all: Generate all files (default if no option specified)
  • --solution <path>: Path to solution file (.sln) (auto-detected if not specified)
  • --settings <path>: Path to launchSettings.json (auto-detected if not specified)
  • --output <path>: Output directory (default: ./deploy-output)

Examples:

# Generate everything in current directory
devops-deploy generate --all

# Generate only Dockerfile in specific directory
devops-deploy generate --docker --output ./docker-files

# Specify files manually
devops-deploy generate --all --solution ./MySolution.sln --settings ./Properties/launchSettings.json

init

Initialize project configuration with interactive wizard.

devops-deploy init

This will create a devops-config.json file with your project settings.

📁 Generated Files Structure

deploy-output/
├── Dockerfile                    # Docker multi-stage build
├── main.tf                      # Terraform main configuration
├── variables.tf                 # Terraform variables
├── outputs.tf                   # Terraform outputs
├── terraform.tfvars.example     # Example variables file
├── deploy.sh                    # Full deployment script
├── quick-deploy.sh              # Quick update script
├── rollback.sh                  # Rollback script
├── status.sh                    # Status check script
└── README.md                    # Deployment guide

🐳 Using the Generated Dockerfile

The generated Dockerfile is optimized for .NET with:

  • Multi-stage build
  • Non-root user for security
  • Configured health check
  • Optimized dependency caching
  • Environment variables from launchSettings.json
# Build image
docker build -t my-microservice .

# Local run for testing
docker run -p 8080:8080 my-microservice

☁️ Deploy with Terraform

  1. Configure variables:

    cp terraform.tfvars.example terraform.tfvars
    # Edit terraform.tfvars with your values
  2. Run Terraform:

    terraform init
    terraform plan
    terraform apply

This will create:

  • ECR Repository on AWS
  • Kubernetes Deployment
  • Kubernetes Service
  • ConfigMaps and Secrets
  • Horizontal Pod Autoscaler
  • Health checks

🚀 Deploy with Bash Scripts

Full Deploy (First time)

chmod +x deploy.sh
./deploy.sh

The script will:

  1. Check prerequisites (AWS CLI, Docker, kubectl)
  2. Create ECR repository if it doesn't exist
  3. Build and push image
  4. Apply Terraform configurations
  5. Check deployment status

Quick Update

For updates after code changes:

./quick-deploy.sh

Check Status

./status.sh

Rollback

If something goes wrong:

./rollback.sh

🔧 Advanced Configuration

Environment Variables

You can configure script behavior:

export AWS_REGION="us-west-2"
export IMAGE_TAG="v1.2.3"
export KUBERNETES_NAMESPACE="my-namespace"
export ENVIRONMENT="production"

./deploy.sh

Dockerfile Customization

If you need to customize the Dockerfile:

  1. Generate base file:

    devops-deploy generate --docker
  2. Edit the generated Dockerfile as needed

  3. Use deployment scripts normally

Custom Terraform Configuration

Most important Terraform variables:

# terraform.tfvars
aws_region = "us-east-1"
environment = "production"
replicas = 3
cpu_limit = "1000m"
memory_limit = "1Gi"
auth_client_id = "your-client-id"
auth_client_secret = "your-client-secret"

🛡️ Security and Best Practices

The tool follows security best practices:

  • Dockerfile: Non-root user, multi-stage build
  • Kubernetes: Resource limits, health checks, secrets for credentials
  • AWS: Restricted IAM policies, ECR image scanning
  • Variables: Secrets separated from configs

🔍 Troubleshooting

Problem: "No solution file found"

Solution: Specify path manually:

devops-deploy generate --solution ./path/to/your.sln --all

Problem: "launchSettings.json not found"

Solution: Check if file exists in Properties/launchSettings.json or specify:

devops-deploy generate --settings ./Properties/launchSettings.json --all

Problem: Deploy fails with AWS authentication error

Solution: Configure AWS CLI:

aws configure
# or use environment variables
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."

Problem: kubectl cannot connect

Solution: Configure kubeconfig:

aws eks update-kubeconfig --region us-east-1 --name my-cluster

📋 Complete Example

Let's say you have a project called "FlowchartService":

# 1. In project directory
cd FlowchartService

# 2. Generate deployment files
devops-deploy generate --all

# 3. Review generated files
ls deploy-output/

# 4. Configure Terraform
cp deploy-output/terraform.tfvars.example deploy-output/terraform.tfvars
# Edit terraform.tfvars with your credentials

# 5. Deploy
cd deploy-output
chmod +x *.sh
./deploy.sh

# 6. Check if it's working
./status.sh

🤝 Contributing

To improve the tool:

  1. Clone the repository
  2. Install dependencies: npm install
  3. Make your changes
  4. Test: npm test
  5. Open a Pull Request

📄 License

MIT License - see LICENSE file for details.


Tip: Add the deploy-output/ directory to your .gitignore if you don't want to version the generated files, or version only the Dockerfile if needed.