devilbox/.tests/Makefile

187 lines
4.1 KiB
Makefile
Raw Normal View History

ifneq (,)
.error This Makefile requires GNU Make.
endif
2018-12-09 00:55:12 +00:00
2018-12-27 12:02:57 +00:00
# -------------------------------------------------------------------------------------------------
# Misc Targets
# -------------------------------------------------------------------------------------------------
update-readme:
cat "../README.md" \
2020-11-07 10:34:52 +00:00
| perl -00 -pe "s#<!-- modules -->.*<!-- /modules -->#<!-- modules -->\n$$(./scripts/get-modules.sh)\n<!-- /modules -->#s" \
> "../README.md.tmp"
yes | mv -f "../README.md.tmp" "../README.md"
2018-12-27 12:02:57 +00:00
2019-11-21 08:43:00 +00:00
# -------------------------------------------------------------------------------------------------
# Linting Targets
# -------------------------------------------------------------------------------------------------
lint-tests:
docker run --rm $(tty -s && echo "-it" || echo) \
-v "$(PWD):/mnt" \
--entrypoint=sh \
koalaman/shellcheck-alpine:stable \
-c "find . -name '*.sh' -print0 | xargs -0 -n1 shellcheck --check-sourced --color=auto --shell=bash"
2018-12-09 00:55:12 +00:00
# -------------------------------------------------------------------------------------------------
# Startup Targets
2018-12-09 00:55:12 +00:00
# -------------------------------------------------------------------------------------------------
###
### Configure .env file
###
configure: ../.env
ifeq ($(KEY),)
$(error Target requires KEY to be set.)
2018-12-09 00:55:12 +00:00
endif
@$(PWD)/scripts/env-setvar.sh "$(KEY)" "$(VAL)"
###
### Pull currently setup images
###
pull: ../.env
@$(PWD)/scripts/compose-pull.sh
2018-12-09 00:55:12 +00:00
###
### Startup Devilbox
###
start: ../.env
2019-11-22 08:14:33 +00:00
@$(MAKE) --no-print-directory configure KEY=HOST_PATH_HTTPD_DATADIR VAL=.tests/www
@$(MAKE) --no-print-directory configure KEY=DEBUG_COMPOSE_ENTRYPOINT VAL=2
@$(MAKE) --no-print-directory configure KEY=NEW_UID VAL=$$(id -u)
@$(MAKE) --no-print-directory configure KEY=NEW_GID VAL=$$(id -g)
@$(PWD)/scripts/compose-start.sh
###
### Stop Devilbox
###
stop:
@$(PWD)/scripts/compose-stop.sh
###
### Show Docker logs
###
logs:
@$(PWD)/scripts/compose-logs.sh
# -------------------------------------------------------------------------------------------------
# Test Targets
# -------------------------------------------------------------------------------------------------
###
2019-11-22 23:02:17 +00:00
### PHP Modules
###
test-smoke-modules:
$(PWD)/tests/modules-curl-vhosts.sh "modules"
$(PWD)/tests/modules-php-vhosts.sh "modules"
$(PWD)/tests/modules-fetch-tests.sh "modules-external"
$(PWD)/tests/modules-curl-vhosts.sh "modules-external"
$(PWD)/tests/modules-php-vhosts.sh "modules-external"
###
2019-11-22 23:02:17 +00:00
### Configuration
###
test-smoke-config:
$(PWD)/tests/config-xdebug.sh
###
2019-11-22 23:02:17 +00:00
### Intranet
###
test-smoke-intranet:
$(PWD)/tests/intranet-homepage.sh
$(PWD)/tests/intranet-vhost.sh
$(PWD)/tests/intranet-email.sh
$(PWD)/tests/intranet-redis.sh
$(PWD)/tests/intranet-memcached.sh
###
2019-11-22 23:02:17 +00:00
### Intranet Vendors
###
test-smoke-vendors:
2019-11-21 08:43:00 +00:00
$(PWD)/tests/vendor-adminer-mysql.sh
$(PWD)/tests/vendor-adminer-pgsql.sh
$(PWD)/tests/vendor-adminer-mongo.sh
$(PWD)/tests/vendor-phpmyadmin.sh
$(PWD)/tests/vendor-phppgadmin.sh
$(PWD)/tests/vendor-phpredmin.sh
2020-01-03 14:39:22 +00:00
$(PWD)/tests/vendor-ocp.sh
###
2019-11-22 23:02:17 +00:00
### Virtual Host
###
test-smoke-vhosts:
$(PWD)/tests/vhost-directory_index.sh
$(PWD)/tests/vhost-vhostgen_default_template.sh
$(PWD)/tests/vhost-vhostgen_customize.sh
###
2019-11-22 23:02:17 +00:00
### Reverse Proxy
###
test-smoke-rproxies:
$(PWD)/tests/rproxy-javascript.sh
###
2019-11-22 23:02:17 +00:00
### SSL
###
test-smoke-ssl:
$(PWD)/tests/ssl-intranet.sh
$(PWD)/tests/ssl-vhost.sh
###
2019-11-22 23:02:17 +00:00
### Bind
###
test-smoke-bind:
@echo noop
###
2019-11-22 23:02:17 +00:00
### Autostart
###
test-smoke-autostart:
$(PWD)/tests/autostart-examples.sh
###
2019-11-22 23:02:17 +00:00
### Frameworks
###
test-smoke-framework-cakephp:
$(PWD)/tests/framework-cakephp.sh
test-smoke-framework-drupal:
$(PWD)/tests/framework-drupal.sh
2018-12-27 12:16:30 +00:00
2019-11-22 22:10:01 +00:00
test-smoke-framework-wordpress:
$(PWD)/tests/framework-wordpress.sh
2018-12-27 12:16:30 +00:00
###
### Container
###
test-smoke-container:
$(PWD)/tests/container-mysql.sh
2018-12-09 00:55:12 +00:00
# -------------------------------------------------------------------------------------------------
# Helper Targets
# -------------------------------------------------------------------------------------------------
###
### Ensure .env file exists
###
../.env:
install -m 0644 ../env-example ../.env