Makefile 3.55 KB
Newer Older
Martin Bless's avatar
Martin Bless committed
1 2 3 4 5 6
# Makefile for t3o/ter
#
# Type 'make' for help.
#


7 8
DOCKER_COMPOSE="$$(pwd)/data/scripts/docker-compose.sh"
COMPOSER="$$(pwd)/data/scripts/composer.sh"
9 10
include .env

Martin Bless's avatar
Martin Bless committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
.PHONY: help
help:
	@echo "Please use 'make <target>' where <target> is one of"
	@echo "  help              to show this menu."
	@echo "  help2             for more help."
	@echo "  init              for: composer-install, install-typo3"
	@echo "  reset             for: kill, down, init"

	@echo "  pull              docker-compose: Pull images for services."
	@echo "  build             docker-compose: Build or rebuild services."
	@echo "  ps                docker-compose: List containers."
	@echo "  up                docker-compose: Build, (re)create, start, and attach"
	@echo "                                    to containers for a service."
	@echo "  down              docker-compose: Stops containers and removes containers, networks,"
	@echo "                                    volumes, and images created by 'up'."
	@echo "  stop              docker-compose: Stop running containers without removing them."
	@echo "  kill              docker-compose: Force stop service containers."
28
	@echo
Martin Bless's avatar
Martin Bless committed
29
	@echo "  install-typo3     docker-compose: Start TYPO3"
30 31
	@echo "  clear-cache       Command Line:   Empty typo3temp/"
	@echo
Martin Bless's avatar
Martin Bless committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
	@echo "  log               Constantly echo log items to the console."
	@echo "  composer-install  PHP Composer: Install."
	@echo "  composer-update   PHP Composer: Update."
	@echo
	@echo "Recommended:"
	@echo "  make init up log"


.PHONY: help2
help2:
	@echo
	@echo "help2"
	@echo "====="
	@echo
	@echo "Once TYPO3 is running direct your browser to one of:"
	@echo "  https://ter.typo3.127.0.0.1.xip.io/typo3/"
	@echo "  https://ter.typo3.127.0.0.1.xip.io/typo3/sysext/install/Start/Install.php"
	@echo
	@echo "For a local installation it may be necessary to have file:"
	@echo "  ./data/typo3/html/typo3conf/AdditionalConfiguration.sample.php"
	@echo "being active as file:"
	@echo "  ./data/typo3/html/typo3conf/AdditionalConfiguration.php"
	@echo "Copy if necessary."
	@echo
	@echo "End of help2."
	@echo



.PHONY: init
62
init: composer-install install-typo3
Martin Bless's avatar
Martin Bless committed
63 64 65 66 67 68 69 70 71
	@echo
	@echo "Direct your browser to:"
	@echo "    https://ter.typo3.127.0.0.1.xip.io/typo3/"
	@echo
	@echo "Type 'make help2' for more help."
	@echo


.PHONY: reset
72
reset: kill down clear-cache init
Martin Bless's avatar
Martin Bless committed
73 74 75 76 77 78 79 80 81 82 83 84 85


.PHONY: pull
pull:
	$(DOCKER_COMPOSE) pull


.PHONY: build
build:
	$(DOCKER_COMPOSE) build --no-cache


.PHONY: ps
86 87
ps:
	$(DOCKER_COMPOSE) ps
Martin Bless's avatar
Martin Bless committed
88 89 90 91 92 93 94 95 96 97 98 99 100


.PHONY: up
up:
	$(DOCKER_COMPOSE) up -d


.PHONY: down
down:
	$(DOCKER_COMPOSE) down --remove-orphans


.PHONY: stop
101 102
stop:
	$(DOCKER_COMPOSE) stop
Martin Bless's avatar
Martin Bless committed
103 104 105


.PHONY: kill
106 107
kill:
	$(DOCKER_COMPOSE) kill
Martin Bless's avatar
Martin Bless committed
108 109 110


.PHONY: install-typo3
111
install-typo3: up
112
	$(DOCKER_COMPOSE) run --rm db /src/data/scripts/wait-for-it.sh -h $(DATABASE_HOST_NAME) -p $(DATABASE_PORT) -t 30
113 114 115 116 117 118 119 120 121 122 123 124 125
	$(DOCKER_COMPOSE) run --rm php ./bin/typo3cms install:setup \
		--non-interactive \
		--force \
		--database-user-name $(DATABASE_USER) \
		--database-user-password $(DATABASE_USER_PASSWORD) \
		--database-host-name $(DATABASE_HOST_NAME) \
		--database-port $(DATABASE_PORT) \
		--database-name $(DATABASE_NAME) \
		--use-existing-database \
		--admin-user-name $(ADMIN_USER_NAME) \
		--admin-password $(ADMIN_PASSWORD) \
		--site-name $(TYPO3_SITENAME) \
		--site-setup-type site
Martin Bless's avatar
Martin Bless committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141


.PHONY: log
log:
	$(DOCKER_COMPOSE) logs -f --tail=100


.PHONY: composer-install
composer-install:
	$(COMPOSER) --working-dir=data/typo3 install


.PHONY: composer-update
composer-update:
	$(COMPOSER) --working-dir=data/typo3 up

142 143 144
.PHONY: clear-cache
clear-cache:
	rm -rf data/typo3/html/typo3temp/*