install: | |
@printf "$$(tput setaf 0)$$(tput setab 2)\n\n Running XYZ TopSecret installation script, this might take a minute...)\n" | |
@echo "$$(tput setaf 7)$$(tput setab 0)" | |
@sleep 1 | |
@echo "$$(tput setaf 3) \n> Making an .env file\n$$(tput setaf 7)" | |
cp .env.example .env | |
@echo "$$(tput setaf 3) \n> Making a docker-compose.yml override copy of your own\n$$(tput setaf 7)" | |
cp docker-compose.override.yml.dist docker-compose.yml | |
@echo "$$(tput setaf 3) \n> Building, recreating and booting up containers (with remove orphans + detach) \n$$(tput setaf 7)" | |
docker-compose up --detach --force-recreate --build --remove-orphans | |
sleep 1 # Because we are not using `depends_on` and `healthcheck` options in `docker-compose.yml` | |
@echo "$$(tput setaf 3) \n> Populating .env.local values with secret tokens and access keys\n$$(tput setaf 7)" | |
@scripts/setup.sh | |
@echo "$$(tput setaf 3) \n> Running composer install\n$$(tput setaf 7)" | |
docker-compose exec php composer install | |
@echo "$$(tput setaf 3) \n> Pinging /api/v1/healthcheck to check if everything is up and running\n$$(tput setaf 7)" | |
curl -IL -k https://localhost/healthz | |
@echo "$$(tput setaf 3) \n> Running database migrations\n$$(tput setaf 7)" | |
docker-compose exec php bin/console doc:mig:mig --no-interaction | |
@echo "$$(tput setaf 3) \n> Loading Fixtures into database\n$$(tput setaf 7)" | |
docker-compose exec php bin/console doctrine:fixtures:load --append | |
@echo "$$(tput setaf 3) \n> Docker containers status\n$$(tput setaf 7)" | |
docker-compose ps | |
@echo "$$(tput setaf 3) \n> Localhost domains you should add to your /etc/hosts file:\n$$(tput setaf 7)" | |
@echo '---------------------------------' | |
@echo '127.0.0.1 first.topsecret.local' | |
@echo '127.0.0.1 second.topsecret.local' | |
@echo '127.0.0.1 third.topsecret.local' | |
@echo '127.0.0.1 main.topsecret.local' | |
@echo '---------------------------------' | |
@echo "$$(tput setaf 3) \n> API Documentation is available at:$$(tput setaf 7)" | |
@echo "$$(tput setaf 6)$$(tput setab 0)\n https://first.topsecret.local/api/doc$$(tput setaf 7)" | |
@echo "$$(tput setaf 6)$$(tput setab 0) https://second.topsecret.local/api/doc$$(tput setaf 7)" | |
@echo "$$(tput setaf 6)$$(tput setab 0) https://third.topsecret.local/api/doc$$(tput setaf 7)" | |
@echo "$$(tput setaf 6)$$(tput setab 0) https://main.topsecret.local/api/doc\n$$(tput setaf 7)" |