homegrade_theme_production/Makefile_prod

62 lines
2.5 KiB
Plaintext

##########################
# SCRIPT DE DÉPLOIEMENT
##########################
include .env_prod
# include .env_dev
RED=\033[0;31m
GREEN=\033[0;32m
YELLOW=\033[0;33m
NC=\033[0m # No Color
deploy: pull-media deploy-theme deploy-plugin
deploy-theme:
@echo "$(GREEN)####Synchronisation des Themes $(NC)"
@rsync -avhp -e 'ssh' ./ $(HOST):$(THEMES_PATH)/$(THEME_FOLDER_NAME) --delete --exclude 'node_modules' --exclude 'Makefile' --exclude 'Makefile_dev' --exclude '.env' --exclude '.env_prod' --exclude '.env_dev' --exclude '.git'
deploy-plugin:
@echo "$(GREEN)####Synchronisation du plugin $(NC)"
@rsync -avhp -e 'ssh' ../../plugins/$(PLUGIN_FOLDER_NAME) $(HOST):$(PLUGINS_PATH) --delete --exclude 'node_modules' --exclude 'Makefile' --exclude 'Makefile_dev' --exclude '.env' --exclude '.env_prod' --exclude '.env_dev' --exclude '.git'
deploy-full-content:
@echo "$(GREEN)####Synchronisation de tout le wp-content$(NC)"
@rsync -avhp -e 'ssh' ../../ $(HOST):$(CONTENT_PATH) --delete --exclude 'node_modules' --exclude 'Makefile' --exclude 'Makefile_dev' --exclude '.env' --exclude '.env_prod' --exclude '.env_dev' --exclude '.git'
pull-media:
@echo "$(GREEN)####Pull des médias $(NC)"
@rsync -avhp -e 'ssh' $(HOST):$(UPLOADS_PATH) ../../uploads --delete
pull-plugins:
@echo "$(GREEN)####Pull des Plugins $(NC)"
@rsync -avhp -e 'ssh' $(HOST):$(PLUGINS_PATH) ../../plugins --delete
bundle:
@echo "$(GREEN)####BUNDLE $(NC)"
@rsync -avh ./* ../$(THEME_DIST_NAME) --delete \
--exclude '.env' \
--exclude '.env_dev' \
--exclude '.env_prod' \
--exclude 'node_modules' \
--exclude 'Makefile' \
--exclude 'Makefile_dev' \
--exclude '.git' \
--exclude '.gitignore' \
--exclude 'composer.json' \
maintenance-on:
@echo "$(YELLOW)####MISE EN MAINTENANCE $(NC)"
@ssh -p $(PORT) $(HOST) "cd $(CONTENT_PATH); cd ..; echo '<?php \$$upgrading = time();' >> .maintenance "
maintenance-off:
@echo "$(GREEN)####MISE EN LIGNE / SUPPRESSION DU MAINTENANCE $(NC)"
@ssh -p $(PORT) $(HOST) "cd $(CONTENT_PATH); cd ..; rm .maintenance "
test-connect:
@echo "$(GREEN)####SIMULATION — TEST DE CONNEXION $(NC)"
@ssh -p $(PORT) $(HOST) "cd $(CONTENT_PATH); pwd"
test-deploy:
@echo "$(RED)####SIMULATION — Synchronisation RSYNC DES FICHIERS $(NC)"
@rsync -avhpn -e 'ssh' ./ $(HOST):$(THEMES_PATH)/$(THEME_FOLDER_NAME)/test --delete --exclude 'node_modules' --exclude 'Makefile' --exclude 'Makefile_dev' --exclude '.git' --exclude '.env' --exclude '.env_prod' --exclude '.env_dev'