From d4f48f557777242f12ef0f29e9ca2325eb43b311 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Mon, 22 Apr 2024 12:27:22 +0200 Subject: [PATCH] switching to dev deploy --- Makefile_prod | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Makefile_prod diff --git a/Makefile_prod b/Makefile_prod new file mode 100644 index 0000000..4397fa0 --- /dev/null +++ b/Makefile_prod @@ -0,0 +1,62 @@ +########################## +# 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 '> .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' \ No newline at end of file