Skip to content

Instantly share code, notes, and snippets.

@aminkhoshzahmat
Last active Jan 14, 2021
Embed
What would you like to do?
Makefile sample file
# =================================
# Variables #
# =================================
CG=\033[0;36m#..........green color
CP=\033[0;35m#...........pink color
CF=\033[0;33m#...........pink color
NC=\033[0m#................no color
SPRINT=1.0.0#...............Version
COMMANDS=${CP}Commands${NC}
DATE=`date +%Y-%m-%d-%H.%M.%S`
#==================================
# Start Program #
#==================================
help:
@echo "${CG}"
@echo " ______ "
@echo " / ____/___ ___ ______ ____ ______ "
@echo " / / / __ / / / / __ \/ __ / ___/ "
@echo " / /___/ /_/ / /_/ / / / / /_/ / /__ "
@echo " \____/\__,_/\__, /_/ /_/\__,_/\___/ "
@echo " /____/ "
@echo "${NC}"
@printf " ${CG}Welcome to Caynac CLI V${SPRINT}${NC}"
@echo ""
@echo " ------------------------------------------------------------"
@echo " In order to work with cli"
@echo " type the command name provided in list below"
@printf " ${CF}for example : ${NC}make ${CP}server${NC}"
@echo " "
@echo " --------------------------------------------------------------------------"
@echo " | # | ${COMMANDS} | Description |"
@echo " --------------------------------------------------------------------------"
@echo " | 1 | server | Runs the server |"
@echo " | 2 | cache | Clears the cache |"
@echo " | 3 | db | Executes db operations |"
@echo " | 4 | phpunit | Executes unit and functional tests |"
@echo " | 5 | dropdb | Drop database and create it again |"
@echo " | 6 | prod | Run migration and load prod fixtures |"
@echo " | 7 | upgradeV15 | Run migration and load changes for new version 1.5|"
@echo " --------------------------------------------------------------------------"
server:
clear
symfony server:start
cache:
symfony console cache:clear
symfony console cache:warmup
db:
symfony console doctrine:database:drop --if-exists --force
symfony console doctrine:database:create
yes | symfony console doctrine:migrations:migrate
yes | symfony console doctrine:fixtures:load --group dev
bin/console bugloos_translation:update en --force --override
symfony console cache:clear
phpunit:
php bin/phpunit
translate:
bin/console cache:clear
bin/console bugloos_translation:update en --force --override
bin/console cache:warmup
dropdb:
symfony console doctrine:database:drop --if-exists --force
symfony console doctrine:database:create
prod:
symfony console doctrine:migrations:migrate
symfony console doctrine:fixtures:load --group prod
bin/console bugloos_translation:update en --force --override
symfony console cache:clear
cleardb:
symfony console doctrine:database:drop --if-exists --force
symfony console doctrine:database:create
symfony console doctrine:database:import ./livedb.sql
upgradeV15:
yes | symfony console doctrine:migrations:migrate
bin/console upgrade:v1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment