Created
January 15, 2020 12:06
-
-
Save wilcorrea/2c53289bfe9bbfadfdeff6da8f3b904a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/make | |
include .env | |
export | |
.PHONY: help | |
.DEFAULT_GOAL := help | |
help: ## Display this help | |
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | |
##@ Initialize work | |
init: ## Start a new develop enviroment | |
cp docker-compose.yml.develop docker-compose.yml | |
cp .env.develop .env | |
##@ Development | |
dev: ## Start dev mode with terminal attached | |
docker-compose up | |
down: ## Start dev mode with terminal attached | |
docker-compose down && docker-compose rm -f | |
migrate: ## Migrate database | |
docker exec -it ${DOCKER_SERVICE_API} bash -c "su -c \"php artisan migrate\" application" | |
rollback: ## Rollback the last migrate | |
docker exec -it ${DOCKER_SERVICE_API} bash -c "su -c \"php artisan migrate:rollback\" application" | |
migration: ## Create a migration file | |
/bin/bash .scripts/migration.sh | |
##@ Deploy | |
stage: ## Publish the app to stage environment | |
/usr/bin/bash ./dist/stage/deploy.sh | |
production: ## Publish the app to production environment | |
/usr/bin/bash ./dist/production/deploy.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment