Skip to content

Instantly share code, notes, and snippets.

@IgorDePaula
Forked from wilcorrea/makefile
Created January 16, 2020 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IgorDePaula/153b667b57a74a57d0d182c56771e054 to your computer and use it in GitHub Desktop.
Save IgorDePaula/153b667b57a74a57d0d182c56771e054 to your computer and use it in GitHub Desktop.
#!/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