From ed6c2ee369d53cb07ea041f31a7379ec0b7bc5f0 Mon Sep 17 00:00:00 2001 From: dimti Date: Tue, 14 Jan 2025 08:27:01 +0300 Subject: [PATCH] + winter restore perms quick helper * wordpress quick script moved into subfolder --- winter/quick/_settings.sh.example | 8 ++++++ winter/quick/restore-perms.sh.example | 29 ++++++++++++++++++++++ {quick => winter/quick}/tmp/.gitignore | 0 .gitignore-example => wordpress/.gitignore-example | 0 {quick => wordpress/quick}/.gitignore | 0 ...tream-and-merged-to-develop-branches.sh.example | 0 {quick => wordpress/quick}/bump.sh.example | 0 .../quick}/create-config.sh.example | 0 .../deactivate-unnecessary-plugins.sh.example | 0 .../quick}/local/replace-domain.sh.example | 0 .../quick}/restore-perms-light.sh.example | 0 .../quick}/restore-perms.sh.example | 0 {quick => wordpress/quick}/settings.sh.example | 0 {quick => wordpress/quick}/sync/.my.cnf.example | 0 .../sync/import-prod-database-to-local.sh.example | 0 .../sync-uploads-from-prod-to-local.sh.example | 0 .../upgrade => wordpress/quick/tmp}/.gitignore | 0 .../wp-content/upgrade}/.gitignore | 0 wordpress/wp-content/uploads/.gitignore | 2 ++ 19 files changed, 39 insertions(+) create mode 100644 winter/quick/_settings.sh.example create mode 100644 winter/quick/restore-perms.sh.example rename {quick => winter/quick}/tmp/.gitignore (100%) rename .gitignore-example => wordpress/.gitignore-example (100%) rename {quick => wordpress/quick}/.gitignore (100%) rename {quick => wordpress/quick}/additional/non-upstream-and-merged-to-develop-branches.sh.example (100%) rename {quick => wordpress/quick}/bump.sh.example (100%) rename {quick => wordpress/quick}/create-config.sh.example (100%) rename {quick => wordpress/quick}/local/deactivate-unnecessary-plugins.sh.example (100%) rename {quick => wordpress/quick}/local/replace-domain.sh.example (100%) rename {quick => wordpress/quick}/restore-perms-light.sh.example (100%) rename {quick => wordpress/quick}/restore-perms.sh.example (100%) rename {quick => wordpress/quick}/settings.sh.example (100%) rename {quick => wordpress/quick}/sync/.my.cnf.example (100%) rename {quick => wordpress/quick}/sync/import-prod-database-to-local.sh.example (100%) rename {quick => wordpress/quick}/sync/sync-uploads-from-prod-to-local.sh.example (100%) rename {wp-content/upgrade => wordpress/quick/tmp}/.gitignore (100%) rename {wp-content/uploads => wordpress/wp-content/upgrade}/.gitignore (100%) create mode 100644 wordpress/wp-content/uploads/.gitignore diff --git a/winter/quick/_settings.sh.example b/winter/quick/_settings.sh.example new file mode 100644 index 0000000..7e206b3 --- /dev/null +++ b/winter/quick/_settings.sh.example @@ -0,0 +1,8 @@ +#!/bin/bash +SETTINGS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# exporting variables dot not effect to visibility for other scripts - all variables is visible + +export TMP_DIR=$SETTINGS_SCRIPT_DIR/tmp + +export THEME=demo diff --git a/winter/quick/restore-perms.sh.example b/winter/quick/restore-perms.sh.example new file mode 100644 index 0000000..6f19970 --- /dev/null +++ b/winter/quick/restore-perms.sh.example @@ -0,0 +1,29 @@ +#!/bin/bash +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +. "$SCRIPT_DIR/_settings.sh" || { + echo "no settings" && exit 1 +} + +APP_DIR="${SCRIPT_DIR}/.." + +PLUGINS=(winter) +THEME_DIRS=(layouts pages partials) +export WEB_GID=33 + +perms() { + sudo chown -R $UID:$WEB_GID "$1" + + sudo chmod -R g+rwx "$1" +} + +perms "${APP_DIR}/storage" +perms "${APP_DIR}/bootstrap/cache" + +for DIR in "${THEME_DIRS[@]}"; do + perms "${APP_DIR}/themes/$THEME/$DIR" +done + +for DIR in "${PLUGINS[@]}"; do + perms "${APP_DIR}/plugins/$DIR" +done diff --git a/quick/tmp/.gitignore b/winter/quick/tmp/.gitignore similarity index 100% rename from quick/tmp/.gitignore rename to winter/quick/tmp/.gitignore diff --git a/.gitignore-example b/wordpress/.gitignore-example similarity index 100% rename from .gitignore-example rename to wordpress/.gitignore-example diff --git a/quick/.gitignore b/wordpress/quick/.gitignore similarity index 100% rename from quick/.gitignore rename to wordpress/quick/.gitignore diff --git a/quick/additional/non-upstream-and-merged-to-develop-branches.sh.example b/wordpress/quick/additional/non-upstream-and-merged-to-develop-branches.sh.example similarity index 100% rename from quick/additional/non-upstream-and-merged-to-develop-branches.sh.example rename to wordpress/quick/additional/non-upstream-and-merged-to-develop-branches.sh.example diff --git a/quick/bump.sh.example b/wordpress/quick/bump.sh.example similarity index 100% rename from quick/bump.sh.example rename to wordpress/quick/bump.sh.example diff --git a/quick/create-config.sh.example b/wordpress/quick/create-config.sh.example similarity index 100% rename from quick/create-config.sh.example rename to wordpress/quick/create-config.sh.example diff --git a/quick/local/deactivate-unnecessary-plugins.sh.example b/wordpress/quick/local/deactivate-unnecessary-plugins.sh.example similarity index 100% rename from quick/local/deactivate-unnecessary-plugins.sh.example rename to wordpress/quick/local/deactivate-unnecessary-plugins.sh.example diff --git a/quick/local/replace-domain.sh.example b/wordpress/quick/local/replace-domain.sh.example similarity index 100% rename from quick/local/replace-domain.sh.example rename to wordpress/quick/local/replace-domain.sh.example diff --git a/quick/restore-perms-light.sh.example b/wordpress/quick/restore-perms-light.sh.example similarity index 100% rename from quick/restore-perms-light.sh.example rename to wordpress/quick/restore-perms-light.sh.example diff --git a/quick/restore-perms.sh.example b/wordpress/quick/restore-perms.sh.example similarity index 100% rename from quick/restore-perms.sh.example rename to wordpress/quick/restore-perms.sh.example diff --git a/quick/settings.sh.example b/wordpress/quick/settings.sh.example similarity index 100% rename from quick/settings.sh.example rename to wordpress/quick/settings.sh.example diff --git a/quick/sync/.my.cnf.example b/wordpress/quick/sync/.my.cnf.example similarity index 100% rename from quick/sync/.my.cnf.example rename to wordpress/quick/sync/.my.cnf.example diff --git a/quick/sync/import-prod-database-to-local.sh.example b/wordpress/quick/sync/import-prod-database-to-local.sh.example similarity index 100% rename from quick/sync/import-prod-database-to-local.sh.example rename to wordpress/quick/sync/import-prod-database-to-local.sh.example diff --git a/quick/sync/sync-uploads-from-prod-to-local.sh.example b/wordpress/quick/sync/sync-uploads-from-prod-to-local.sh.example similarity index 100% rename from quick/sync/sync-uploads-from-prod-to-local.sh.example rename to wordpress/quick/sync/sync-uploads-from-prod-to-local.sh.example diff --git a/wp-content/upgrade/.gitignore b/wordpress/quick/tmp/.gitignore similarity index 100% rename from wp-content/upgrade/.gitignore rename to wordpress/quick/tmp/.gitignore diff --git a/wp-content/uploads/.gitignore b/wordpress/wp-content/upgrade/.gitignore similarity index 100% rename from wp-content/uploads/.gitignore rename to wordpress/wp-content/upgrade/.gitignore diff --git a/wordpress/wp-content/uploads/.gitignore b/wordpress/wp-content/uploads/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/wordpress/wp-content/uploads/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore