[{"data":1,"prerenderedAt":299},["ShallowReactive",2],{"article:\u002Farticles\u002Fsimplify-your-build-process-with-makefile":3,"article-surround:\u002Farticles\u002Fsimplify-your-build-process-with-makefile":290},{"id":4,"title":5,"body":6,"date":278,"description":279,"draft":280,"extension":281,"meta":282,"navigation":94,"path":283,"seo":284,"stem":285,"tags":286,"__hash__":289},"articles\u002Farticles\u002Fsimplify-your-build-process-with-makefile.md","Simplify Your Build Process with Makefile",{"type":7,"value":8,"toc":276},"minimark",[9,13,29,32,35,38,272],[10,11,12],"p",{},"I love using Makefiles to simplify and organize the build logic of my projects.",[10,14,15,16,20,21,24,25,28],{},"Simplify the build process by eliminating manual commands and adopting standardized ",[17,18,19],"code",{},"make"," commands such as ",[17,22,23],{},"make build"," and ",[17,26,27],{},"make start"," to build projects across different languages and frameworks.",[10,30,31],{},"Organize your build logic into neat, reusable sections. Makefiles can keep your build process clean and understandable, abstracting away the complex parts of your build process and allowing you to organize your logic in one place.",[10,33,34],{},"You can also integrate with other tools, enabling you to run steps either in sequence or concurrently to speed up builds.",[10,36,37],{},"May require some additional setup on Windows 😬",[39,40,45],"pre",{"className":41,"code":42,"language":43,"meta":44,"style":44},"language-makefile shiki shiki-themes github-dark github-light","# .\u002FMakefile\n# Build our Docker image\n.PHONY: build\nbuild:\n    @docker-compose -f docker-compose.yml build\n\n# Start Docker Compose Containers\n.PHONY: start\nstart:\n    @docker-compose up -d --build app\n\n# Run app container run database migrations\n.PHONY: migrate\nmigrate:\n    @docker exec app php vendor\u002Fbin\u002Fphinx migrate\n\n# Run app container seed database\n.PHONY: seed\nseed:\n    @docker exec app php vendor\u002Fbin\u002Fphinx seed:run\n\n# Run composer container and run install\n.PHONY: composer-install\ncomposer-install:\n    @docker-compose run --rm composer install\n\n# Run composer container and run update\n.PHONY: composer-update\ncomposer-update\n    @docker-compose run --rm composer update\n","makefile","",[17,46,47,56,62,73,83,89,96,102,110,118,124,129,135,143,151,157,162,168,176,184,208,213,219,227,235,241,246,252,260,266],{"__ignoreMap":44},[48,49,52],"span",{"class":50,"line":51},"line",1,[48,53,55],{"class":54},"si27w","# .\u002FMakefile\n",[48,57,59],{"class":50,"line":58},2,[48,60,61],{"class":54},"# Build our Docker image\n",[48,63,65,69],{"class":50,"line":64},3,[48,66,68],{"class":67},"sTU5a",".PHONY",[48,70,72],{"class":71},"shWlK",": build\n",[48,74,76,80],{"class":50,"line":75},4,[48,77,79],{"class":78},"sqoU-","build",[48,81,82],{"class":71},":\n",[48,84,86],{"class":50,"line":85},5,[48,87,88],{"class":71},"    @docker-compose -f docker-compose.yml build\n",[48,90,92],{"class":50,"line":91},6,[48,93,95],{"emptyLinePlaceholder":94},true,"\n",[48,97,99],{"class":50,"line":98},7,[48,100,101],{"class":54},"# Start Docker Compose Containers\n",[48,103,105,107],{"class":50,"line":104},8,[48,106,68],{"class":67},[48,108,109],{"class":71},": start\n",[48,111,113,116],{"class":50,"line":112},9,[48,114,115],{"class":78},"start",[48,117,82],{"class":71},[48,119,121],{"class":50,"line":120},10,[48,122,123],{"class":71},"    @docker-compose up -d --build app\n",[48,125,127],{"class":50,"line":126},11,[48,128,95],{"emptyLinePlaceholder":94},[48,130,132],{"class":50,"line":131},12,[48,133,134],{"class":54},"# Run app container run database migrations\n",[48,136,138,140],{"class":50,"line":137},13,[48,139,68],{"class":67},[48,141,142],{"class":71},": migrate\n",[48,144,146,149],{"class":50,"line":145},14,[48,147,148],{"class":78},"migrate",[48,150,82],{"class":71},[48,152,154],{"class":50,"line":153},15,[48,155,156],{"class":71},"    @docker exec app php vendor\u002Fbin\u002Fphinx migrate\n",[48,158,160],{"class":50,"line":159},16,[48,161,95],{"emptyLinePlaceholder":94},[48,163,165],{"class":50,"line":164},17,[48,166,167],{"class":54},"# Run app container seed database\n",[48,169,171,173],{"class":50,"line":170},18,[48,172,68],{"class":67},[48,174,175],{"class":71},": seed\n",[48,177,179,182],{"class":50,"line":178},19,[48,180,181],{"class":78},"seed",[48,183,82],{"class":71},[48,185,187,190,193,196,199,202,205],{"class":50,"line":186},20,[48,188,189],{"class":78},"    @docker",[48,191,192],{"class":78}," exec",[48,194,195],{"class":78}," app",[48,197,198],{"class":78}," php",[48,200,201],{"class":78}," vendor\u002Fbin\u002Fphinx",[48,203,204],{"class":78}," seed",[48,206,207],{"class":71},":run\n",[48,209,211],{"class":50,"line":210},21,[48,212,95],{"emptyLinePlaceholder":94},[48,214,216],{"class":50,"line":215},22,[48,217,218],{"class":54},"# Run composer container and run install\n",[48,220,222,224],{"class":50,"line":221},23,[48,223,68],{"class":67},[48,225,226],{"class":71},": composer-install\n",[48,228,230,233],{"class":50,"line":229},24,[48,231,232],{"class":78},"composer-install",[48,234,82],{"class":71},[48,236,238],{"class":50,"line":237},25,[48,239,240],{"class":71},"    @docker-compose run --rm composer install\n",[48,242,244],{"class":50,"line":243},26,[48,245,95],{"emptyLinePlaceholder":94},[48,247,249],{"class":50,"line":248},27,[48,250,251],{"class":54},"# Run composer container and run update\n",[48,253,255,257],{"class":50,"line":254},28,[48,256,68],{"class":67},[48,258,259],{"class":71},": composer-update\n",[48,261,263],{"class":50,"line":262},29,[48,264,265],{"class":71},"composer-update\n",[48,267,269],{"class":50,"line":268},30,[48,270,271],{"class":71},"    @docker-compose run --rm composer update\n",[273,274,275],"style",{},"html pre.shiki code .si27w, html code.shiki .si27w{--shiki-default:#6A737D;--shiki-light:#6A737D}html pre.shiki code .sTU5a, html code.shiki .sTU5a{--shiki-default:#79B8FF;--shiki-light:#005CC5}html pre.shiki code .shWlK, html code.shiki .shWlK{--shiki-default:#E1E4E8;--shiki-light:#24292E}html pre.shiki code .sqoU-, html code.shiki .sqoU-{--shiki-default:#B392F0;--shiki-light:#6F42C1}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}",{"title":44,"searchDepth":58,"depth":58,"links":277},[],"2024-03-10","Turn scattered build commands into simple, standardised make targets - one clean, reusable entry point that works across languages and frameworks.",false,"md",{},"\u002Farticles\u002Fsimplify-your-build-process-with-makefile",{"title":5,"description":279},"articles\u002Fsimplify-your-build-process-with-makefile",[287,288,19],"tooling","devex","4YDBdhFU8qg2VfxL7jC7FMa7BftvDKPB8V9ygQ4ghQg",[291,295],{"title":292,"path":293,"stem":294,"children":-1},"PSR-4 - Autoloader","\u002Farticles\u002Fpsr4-autoloader","articles\u002Fpsr4-autoloader",{"title":296,"path":297,"stem":298,"children":-1},"Skinny Controllers, Fat Models","\u002Farticles\u002Fskinny-controllers-fat-models","articles\u002Fskinny-controllers-fat-models",1782332464092]