Last active
August 21, 2019 19:37
-
-
Save piotrkochan/cd0dc28f7223ede441c403423e57875e to your computer and use it in GitHub Desktop.
Simple Makefile which builds Symfony 4 App and make it easier to deploy via FTP or similar method.
This file contains 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
DIST = dist | |
clean: | |
rm -rf $(DIST)/ | |
mkdir $(DIST)/ | |
copy: | |
cp -r assets bin config src templates tests translations $(DIST)/ | |
cp composer.json composer.lock package.json symfony.lock yarn.lock $(DIST)/ | |
cp webpack.config.js $(DIST)/ | |
mkdir $(DIST)/var | |
mkdir $(DIST)/public | |
cp public/.htaccess public/index.php $(DIST)/public/ | |
cp -r public/images $(DIST)/public/ | |
rm -rf $(DIST)/public/uploads | |
composer: | |
# .env.prod is something what could be done better here | |
cp .env .env.prod $(DIST)/ | |
APP_ENV=prod composer install -d $(DIST)/ --no-dev --optimize-autoloader --no-scripts | |
cd $(DIST); php bin/console --env=prod assets:install | |
frontend: | |
cd $(DIST); yarn | |
cd $(DIST); yarn build | |
rm -rf $(DIST)/node_modules | |
zip: | |
zip -r build.zip $(DIST)/* && rm -rf $(DIST)/* && mv build.zip $(DIST) | |
build: clean copy composer frontend zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment