33.PHONY : infra-init infra-plan infra-apply infra-destroy infra-status infra-refresh-state
44.PHONY : infra-config-development infra-config-production infra-validate-config
55.PHONY : infra-test-prereq infra-test-ci infra-test-local
6+ .PHONY : infra-providers infra-environments provider-info
67.PHONY : app-deploy app-redeploy app-health-check
78.PHONY : app-test-config app-test-containers app-test-services
89.PHONY : vm-ssh vm-console vm-gui-console vm-clean-ssh vm-prepare-ssh vm-status
910.PHONY : dev-setup dev-deploy dev-test dev-clean
1011
1112# Default variables
1213VM_NAME ?= torrust-tracker-demo
14+ # Default values
1315ENVIRONMENT ?= development
16+ PROVIDER ?= libvirt
1417TERRAFORM_DIR = infrastructure/terraform
1518INFRA_TESTS_DIR = infrastructure/tests
1619TESTS_DIR = tests
@@ -43,9 +46,9 @@ help: ## Show this help message
4346 @echo " ⚙️ SYSTEM SETUP:"
4447 @awk ' BEGIN {FS = ":.*?## "} /^(install-deps|clean).*:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST )
4548 @echo " "
46- @echo " Examples :"
47- @echo " make dev-deploy ENVIRONMENT=development"
48- @echo " make infra-apply ENVIRONMENT=development"
49+ @echo " Development examples :"
50+ @echo " make dev-deploy ENVIRONMENT=development PROVIDER=libvirt "
51+ @echo " make infra-apply ENVIRONMENT=development PROVIDER=libvirt "
4952 @echo " make app-deploy ENVIRONMENT=development"
5053
5154install-deps : # # Install required dependencies (Ubuntu/Debian)
@@ -61,35 +64,66 @@ install-deps: ## Install required dependencies (Ubuntu/Debian)
6164# =============================================================================
6265
6366infra-init : # # Initialize infrastructure (Terraform init)
64- @echo " Initializing infrastructure for $( ENVIRONMENT) ..."
65- $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) init
67+ @echo " Initializing infrastructure for $( ENVIRONMENT) on $( PROVIDER ) ..."
68+ $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) $( PROVIDER ) init
6669
6770infra-plan : # # Plan infrastructure changes
68- @echo " Planning infrastructure for $( ENVIRONMENT) ..."
69- $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) plan
71+ @echo " Planning infrastructure for $( ENVIRONMENT) on $( PROVIDER ) ..."
72+ $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) $( PROVIDER ) plan
7073
7174infra-apply : # # Provision infrastructure (platform setup)
72- @echo " Provisioning infrastructure for $( ENVIRONMENT) ..."
75+ @echo " Provisioning infrastructure for $( ENVIRONMENT) on $( PROVIDER ) ..."
7376 @echo " ⚠️ This command may prompt for your password for sudo operations"
7477 @if [ " $( SKIP_WAIT) " = " true" ]; then \
7578 echo " ⚠️ SKIP_WAIT=true - Infrastructure will not wait for full readiness" ; \
7679 else \
7780 echo " ℹ️ Infrastructure will wait for full readiness (use SKIP_WAIT=true to skip)" ; \
7881 fi
79- SKIP_WAIT=$(SKIP_WAIT ) $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) apply
82+ SKIP_WAIT=$(SKIP_WAIT ) $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) $( PROVIDER ) apply
8083
8184infra-destroy : # # Destroy infrastructure
82- @echo " Destroying infrastructure for $( ENVIRONMENT) ..."
83- $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) destroy
85+ @echo " Destroying infrastructure for $( ENVIRONMENT) on $( PROVIDER ) ..."
86+ $(SCRIPTS_DIR ) /provision-infrastructure.sh $(ENVIRONMENT ) $( PROVIDER ) destroy
8487
8588infra-status : # # Show infrastructure status
86- @echo " Infrastructure status for $( ENVIRONMENT) :"
89+ @echo " Infrastructure status for $( ENVIRONMENT) on $( PROVIDER ) :"
8790 @cd $(TERRAFORM_DIR ) && tofu show -no-color | grep -E " (vm_ip|vm_status)" || echo " No infrastructure found"
8891
8992infra-refresh-state : # # Refresh Terraform state to detect IP changes
9093 @echo " Refreshing Terraform state..."
9194 @cd $(TERRAFORM_DIR ) && tofu refresh
9295
96+ # Provider and environment information
97+ infra-providers : # # List available infrastructure providers
98+ @echo " Available Infrastructure Providers:"
99+ @$(SCRIPTS_DIR ) /providers/provider-interface.sh list || echo " No providers found"
100+ @echo " "
101+ @echo " Usage examples:"
102+ @echo " make infra-apply ENVIRONMENT=development PROVIDER=libvirt"
103+ @echo " make infra-apply ENVIRONMENT=staging PROVIDER=digitalocean"
104+ @echo " make infra-apply ENVIRONMENT=production PROVIDER=hetzner"
105+
106+ infra-environments : # # List available environments
107+ @echo " Available Environments:"
108+ @ls infrastructure/config/environments/* .env \
109+ infrastructure/config/environments/* .env.tpl 2> /dev/null | \
110+ xargs -I {} basename {} | sed ' s/\.env.*//g' | sort | uniq || \
111+ echo " No environments found"
112+ @echo " "
113+ @echo " Environments:"
114+ @echo " development - Local development and testing"
115+ @echo " staging - Pre-production testing"
116+ @echo " production - Production deployment"
117+
118+ provider-info : # # Show provider information (requires PROVIDER=<name>)
119+ @if [ -z " $( PROVIDER) " ]; then \
120+ echo " Error: PROVIDER not specified" ; \
121+ echo " Usage: make provider-info PROVIDER=<provider>" ; \
122+ exit 1; \
123+ fi
124+ @echo " Getting information for provider: $( PROVIDER) "
125+ @$(SCRIPTS_DIR ) /providers/provider-interface.sh info $(PROVIDER )
126+
93127infra-config-development : # # Generate development environment configuration
94128 @echo " Configuring development environment..."
95129 $(SCRIPTS_DIR ) /configure-env.sh development
0 commit comments