Project Command Use Cases¶
The thothctl project command is designed to support various project management use cases for development teams. This page outlines common use cases and how to implement them using ThothCTL.
Creating Reusable Templates¶
Convert successful projects into templates that can be reused across your organization.
# Navigate to a project that you want to templatize
cd successful-project
# Convert the project to a template
thothctl project convert --make-template --template-project-type terraform
This allows you to: - Standardize infrastructure patterns - Share best practices across teams - Accelerate new project creation - Ensure consistency in your infrastructure
Bootstrapping New Projects¶
Quickly create new projects based on proven templates to accelerate development.
# Navigate to where you want to create the new project
cd projects
# Create a new project from a template
thothctl project convert --make-project --template-project-type terraform
This helps you: - Start new projects quickly - Ensure adherence to organizational standards - Reduce setup time for developers - Maintain consistency across projects
Migrating Between IaC Frameworks¶
Convert projects between different Infrastructure as Code frameworks to adapt to changing requirements.
# Convert a Terraform project to use Terramate for advanced deployment patterns
thothctl project convert --make-terramate-stacks
This enables you to: - Adopt new tools without starting from scratch - Leverage advanced features of different frameworks - Modernize legacy infrastructure code - Implement more sophisticated deployment patterns
Preparing for Code Reviews¶
Clean up projects before submitting them for code review to focus reviewers on relevant changes.
# Clean up the project
thothctl project cleanup
# Commit the changes
git add .
git commit -m "chore: Clean up project for review"
git push
This ensures: - Reviewers focus on actual code changes - No temporary or generated files are included - Cleaner diffs in pull requests - More efficient code review process
Standardizing Project Structure¶
Use templates to enforce a standard project structure across your organization.
# Create a new project with standardized structure
thothctl project convert --make-project --template-project-type terraform
This helps with: - Onboarding new team members - Ensuring consistent organization of files - Making projects more maintainable - Enabling automation across projects
Preparing for Deployment¶
Clean up projects before deployment to reduce package size and remove unnecessary files.
# Clean up the project
thothctl project cleanup
# Package for deployment
tar -czf deployment.tar.gz .
This ensures: - Smaller deployment packages - No sensitive or temporary files are deployed - Cleaner production environments - More efficient deployments
Creating Environment-Specific Configurations¶
Use templates with parameterization to create environment-specific configurations.
# Create a project from a template
thothctl project convert --make-project --template-project-type terraform
# Answer prompts for environment-specific values
# (ThothCTL will prompt for values to replace placeholders)
This allows you to: - Maintain consistent infrastructure across environments - Customize configurations for different environments - Reduce duplication of code - Simplify environment management
Implementing Compliance Requirements¶
Use templates to enforce compliance requirements across projects.
# Create a compliant project from a template
thothctl project convert --make-project --template-project-type terraform
This helps with: - Ensuring security best practices - Meeting regulatory requirements - Implementing organizational policies - Standardizing compliance controls
Cleaning Up After Testing¶
Clean up residual files and directories after testing to maintain a clean workspace.
# Run tests
./run_tests.sh
# Clean up after testing
thothctl project cleanup -cfd test-results,coverage -cfs *.log
This ensures: - Clean workspace after testing - No test artifacts in version control - Reduced disk space usage - Clear separation between test and production artifacts
Preparing for Handover¶
Clean up and standardize projects before handing them over to another team.
# Clean up the project
thothctl project cleanup
# Convert to a well-documented template if needed
thothctl project convert --make-template --template-project-type terraform
This helps with: - Smoother transitions between teams - Better documentation of project structure - Removal of personal or temporary files - Clearer understanding of project components
Implementing DevOps Best Practices¶
Use project templates to enforce DevOps best practices across your organization.
# Create a new project with built-in CI/CD configuration
thothctl project convert --make-project --template-project-type terraform
# The template includes:
# - CI/CD pipeline configuration
# - Testing framework setup
# - Security scanning integration
# - Documentation generation
This ensures: - Consistent CI/CD practices - Built-in testing and security - Standardized deployment processes - Better DevOps adoption across teams
Managing Multi-Environment Infrastructure¶
Use Terramate stacks to manage infrastructure across multiple environments.
This enables: - Better organization of multi-environment infrastructure - Reuse of common configurations - Simplified management of environment differences - More advanced deployment patterns
Implementing Infrastructure Patterns¶
Create templates for common infrastructure patterns to ensure consistency.
# Create a template for a specific infrastructure pattern
cd reference-implementation
thothctl project convert --make-template --template-project-type terraform
# Later, create a new project using this pattern
cd new-project
thothctl project convert --make-project --template-project-type terraform
This helps with: - Standardizing common infrastructure components - Implementing proven patterns - Reducing duplication of effort - Ensuring best practices are followed