From c107c755fc89d28fc708e4d000ca235ef281000e Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 9 Sep 2020 10:33:08 +0100 Subject: [PATCH] tidy up --- dev-production-universal/README.md | 11 +------ .../config/local}/php | 2 +- .../config/local/webserver | 4 +-- dev-production-universal/config/remote/php | 2 +- .../config/remote/webserver | 4 +-- dev-production-universal/pull-from.sh | 23 ------------- dev-production-universal/push-to.sh | 3 -- dev-production-universal/scripts/export-wp.sh | 32 ------------------- dev-production-universal/scripts/import-wp.sh | 3 -- 9 files changed, 7 insertions(+), 77 deletions(-) rename {install/config/remote => dev-production-universal/config/local}/php (63%) delete mode 100755 dev-production-universal/pull-from.sh delete mode 100755 dev-production-universal/push-to.sh delete mode 100755 dev-production-universal/scripts/export-wp.sh delete mode 100755 dev-production-universal/scripts/import-wp.sh diff --git a/dev-production-universal/README.md b/dev-production-universal/README.md index a5fb99f..9f688dd 100644 --- a/dev-production-universal/README.md +++ b/dev-production-universal/README.md @@ -1,10 +1 @@ - -Development environment base packages: - -* nvm -* lf -* lazygit - -## TODO - -* make sure to use export in all config files (the newer ones aren't) +Installation scripts for local/remote servers with development environment. diff --git a/install/config/remote/php b/dev-production-universal/config/local/php similarity index 63% rename from install/config/remote/php rename to dev-production-universal/config/local/php index 1151bc3..8141bb3 100644 --- a/install/config/remote/php +++ b/dev-production-universal/config/local/php @@ -1,5 +1,5 @@ ## php configuration # ## uncomment if using php -#export php_version='latest' +export php_version='latest' diff --git a/dev-production-universal/config/local/webserver b/dev-production-universal/config/local/webserver index a959479..b1c7288 100644 --- a/dev-production-universal/config/local/webserver +++ b/dev-production-universal/config/local/webserver @@ -1,6 +1,6 @@ -apache2_version='latest' +export apache2_version='latest' -#nginx_version='latest' +#export nginx_version='latest' ## specify specific version from latest, 54, 55, 56, 70, 71, 72, 73 or 74 #export litespeed_version='latest' diff --git a/dev-production-universal/config/remote/php b/dev-production-universal/config/remote/php index 0180cae..1151bc3 100644 --- a/dev-production-universal/config/remote/php +++ b/dev-production-universal/config/remote/php @@ -1,5 +1,5 @@ ## php configuration # ## uncomment if using php -# php_version='latest' +#export php_version='latest' diff --git a/dev-production-universal/config/remote/webserver b/dev-production-universal/config/remote/webserver index 0b76e1f..b04745a 100644 --- a/dev-production-universal/config/remote/webserver +++ b/dev-production-universal/config/remote/webserver @@ -1,6 +1,6 @@ -# apache2_version='latest' +#export apache2_version='latest' -#nginx_version='latest' +#export nginx_version='latest' ## specify specific version from latest, 54, 55, 56, 70, 71, 72, 73 or 74 #export litespeed_version='latest' diff --git a/dev-production-universal/pull-from.sh b/dev-production-universal/pull-from.sh deleted file mode 100755 index 3278b50..0000000 --- a/dev-production-universal/pull-from.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -_target="$1" - -if ! [ "$_target" = local ] && ! [ "$_target" = remote ] ; then - echo "Error: must specify 'local' or 'remote' target" - exit 1 -fi - -echo "Loading $_target configuration" - -# source our config files -for _file in ./config/$_target/* ; do - [ -e "$_file" ] || continue - . "$_file" -done - -# check we have ssh access -[ -z "$ssh_user" ] && echo "Error: no user ssh configuration specified" && exit 5 - -if [ -n "$wp_user" ] ; then - . ./scripts/export-wp.sh -fi diff --git a/dev-production-universal/push-to.sh b/dev-production-universal/push-to.sh deleted file mode 100755 index 829303e..0000000 --- a/dev-production-universal/push-to.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - - diff --git a/dev-production-universal/scripts/export-wp.sh b/dev-production-universal/scripts/export-wp.sh deleted file mode 100755 index 408e1a3..0000000 --- a/dev-production-universal/scripts/export-wp.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -echo "Exporting from $url .." - -_timestamp="$(date +%s)" -_db_filename="wordpress-$_timestamp.db" -_archive_filename="wordpress-$_timestamp.tar.gz" -_local_dest_dir="./data/$_target" - -# check we have ssh access -[ -z "$ssh_user" ] && echo "Error: no user ssh configuration specified" && exit 5 - -ssh -T $ssh_user << EOSSH -cd "$wp_path" -wp db export \ - --path="$wp_path" \ - --dbuser="$db_user" \ - --dbpass="$db_pass" \ - --add-drop-table \ - --allow-root \ - "/tmp/$_db_filename" -tar czf "/tmp/$_archive_filename" "$wp_path" -EOSSH - -scp "$ssh_user:/tmp/$_archive_filename" "$_local_dest_dir/$_archive_filename" -scp "$ssh_user:/tmp/$_db_filename" "$_local_dest_dir/$_db_filename" - -exit -ssh -T $ssh_user << EOSSH -rm "/tmp/$_db_filename" -rm "/tmp/$_archive_filename" -EOSSH diff --git a/dev-production-universal/scripts/import-wp.sh b/dev-production-universal/scripts/import-wp.sh deleted file mode 100755 index 829303e..0000000 --- a/dev-production-universal/scripts/import-wp.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -