1
1
# Makefile for Torrust Tracker Demo - Twelve-Factor App Deployment
2
2
.PHONY : help install-deps test-e2e lint test-unit clean
3
3
.PHONY : infra-init infra-plan infra-apply infra-destroy infra-status infra-refresh-state
4
- .PHONY : infra-config-development infra-config-production infra-config-e2e infra-config-testing infra-config-staging infra-validate-config
4
+ .PHONY : infra-config infra-validate-config
5
5
.PHONY : infra-test-prereq infra-test-ci infra-test-local
6
6
.PHONY : infra-providers infra-environments provider-info
7
7
.PHONY : app-deploy app-redeploy app-health-check
@@ -69,9 +69,9 @@ help: ## Show this help message
69
69
@echo " make app-deploy ENVIRONMENT_TYPE=development ENVIRONMENT_FILE=development-libvirt"
70
70
@echo " "
71
71
@echo " Configuration examples:"
72
- @echo " make infra-config- development PROVIDER=libvirt # Create development-libvirt.env"
73
- @echo " make infra-config- production PROVIDER=hetzner # Create production-hetzner.env"
74
- @echo " make infra-config- e2e PROVIDER=libvirt # Create e2e-libvirt.env"
72
+ @echo " make infra-config ENVIRONMENT_TYPE= development PROVIDER=libvirt # Create development-libvirt.env"
73
+ @echo " make infra-config ENVIRONMENT_TYPE= production PROVIDER=hetzner # Create production-hetzner.env"
74
+ @echo " make infra-config ENVIRONMENT_TYPE= e2e PROVIDER=libvirt # Create e2e-libvirt.env"
75
75
76
76
install-deps : # # Install required dependencies (Ubuntu/Debian)
77
77
@echo " Installing dependencies..."
@@ -167,8 +167,8 @@ infra-environments: ## List available environments and their providers
167
167
@echo " production - Production deployment"
168
168
@echo " "
169
169
@echo " Usage examples:"
170
- @echo " make infra-config- development PROVIDER=libvirt # Create development-libvirt.env"
171
- @echo " make infra-config- production PROVIDER=hetzner # Create production-hetzner.env"
170
+ @echo " make infra-config ENVIRONMENT_TYPE= development PROVIDER=libvirt # Create development-libvirt.env"
171
+ @echo " make infra-config ENVIRONMENT_TYPE= production PROVIDER=hetzner # Create production-hetzner.env"
172
172
@echo " make infra-apply ENVIRONMENT_TYPE=development ENVIRONMENT_FILE=development-libvirt"
173
173
@echo " make infra-apply ENVIRONMENT_TYPE=production ENVIRONMENT_FILE=production-hetzner"
174
174
@@ -181,60 +181,25 @@ provider-info: ## Show provider information (requires PROVIDER=<name>)
181
181
@echo " Getting information for provider: $( PROVIDER) "
182
182
@$(SCRIPTS_DIR ) /providers/provider-interface.sh info $(PROVIDER )
183
183
184
- infra-config-development : # # Generate development environment configuration (requires PROVIDER=<name>)
185
- @if [ -z " $( PROVIDER) " ]; then \
186
- echo " Error: PROVIDER not specified" ; \
187
- echo " Usage: make infra-config-development PROVIDER=<provider>" ; \
188
- echo " Available providers: libvirt, hetzner" ; \
189
- echo " Example: make infra-config-development PROVIDER=libvirt" ; \
190
- exit 1; \
191
- fi
192
- @echo " Configuring development environment for $( PROVIDER) ..."
193
- $(SCRIPTS_DIR ) /configure-env.sh development $(PROVIDER )
194
-
195
- infra-config-production : # # Generate production environment configuration (requires PROVIDER=<name>)
196
- @if [ -z " $( PROVIDER) " ]; then \
197
- echo " Error: PROVIDER not specified" ; \
198
- echo " Usage: make infra-config-production PROVIDER=<provider>" ; \
199
- echo " Available providers: libvirt, hetzner" ; \
200
- echo " Example: make infra-config-production PROVIDER=hetzner" ; \
201
- exit 1; \
202
- fi
203
- @echo " Configuring production environment for $( PROVIDER) ..."
204
- $(SCRIPTS_DIR ) /configure-env.sh production $(PROVIDER )
205
-
206
- infra-config-e2e : # # Generate e2e environment configuration (requires PROVIDER=<name>)
207
- @if [ -z " $( PROVIDER) " ]; then \
208
- echo " Error: PROVIDER not specified" ; \
209
- echo " Usage: make infra-config-e2e PROVIDER=<provider>" ; \
210
- echo " Available providers: libvirt, hetzner" ; \
211
- echo " Example: make infra-config-e2e PROVIDER=libvirt" ; \
212
- exit 1; \
213
- fi
214
- @echo " Configuring e2e environment for $( PROVIDER) ..."
215
- $(SCRIPTS_DIR ) /configure-env.sh e2e $(PROVIDER )
216
-
217
- infra-config-testing : # # Generate testing environment configuration (requires PROVIDER=<name>)
218
- @if [ -z " $( PROVIDER) " ]; then \
219
- echo " Error: PROVIDER not specified" ; \
220
- echo " Usage: make infra-config-testing PROVIDER=<provider>" ; \
184
+ infra-config : # # Generate environment configuration (requires ENVIRONMENT_TYPE and PROVIDER)
185
+ @if [ -z " $( ENVIRONMENT_TYPE) " ]; then \
186
+ echo " Error: ENVIRONMENT_TYPE not specified" ; \
187
+ echo " Usage: make infra-config ENVIRONMENT_TYPE=<type> PROVIDER=<provider>" ; \
188
+ echo " Available environment types: development, testing, e2e, staging, production" ; \
221
189
echo " Available providers: libvirt, hetzner" ; \
222
- echo " Example: make infra-config-testing PROVIDER=libvirt" ; \
190
+ echo " Example: make infra-config ENVIRONMENT_TYPE=development PROVIDER=libvirt" ; \
223
191
exit 1; \
224
192
fi
225
- @echo " Configuring testing environment for $( PROVIDER) ..."
226
- $(SCRIPTS_DIR ) /configure-env.sh testing $(PROVIDER )
227
-
228
- infra-config-staging : # # Generate staging environment configuration (requires PROVIDER=<name>)
229
193
@if [ -z " $( PROVIDER) " ]; then \
230
194
echo " Error: PROVIDER not specified" ; \
231
- echo " Usage: make infra-config-staging PROVIDER=<provider>" ; \
195
+ echo " Usage: make infra-config ENVIRONMENT_TYPE=<type> PROVIDER=<provider>" ; \
196
+ echo " Available environment types: development, testing, e2e, staging, production" ; \
232
197
echo " Available providers: libvirt, hetzner" ; \
233
- echo " Example: make infra-config-staging PROVIDER=hetzner " ; \
198
+ echo " Example: make infra-config ENVIRONMENT_TYPE=development PROVIDER=libvirt " ; \
234
199
exit 1; \
235
200
fi
236
- @echo " Configuring staging environment for $( PROVIDER) ..."
237
- $(SCRIPTS_DIR ) /configure-env.sh staging $(PROVIDER )
201
+ @echo " Configuring $( ENVIRONMENT_TYPE ) environment for $( PROVIDER) ..."
202
+ $(SCRIPTS_DIR ) /configure-env.sh $( ENVIRONMENT_TYPE ) $(PROVIDER )
238
203
239
204
infra-validate-config : # # Validate configuration for all environments
240
205
@echo " Validating configuration..."
0 commit comments