This commit is contained in:
Ray Elliott 2020-09-09 10:33:08 +01:00
parent 89d8286021
commit c107c755fc
9 changed files with 7 additions and 77 deletions

View File

@ -1,10 +1 @@
Installation scripts for local/remote servers with development environment.
Development environment base packages:
* nvm
* lf
* lazygit
## TODO
* make sure to use export in all config files (the newer ones aren't)

View File

@ -1,5 +1,5 @@
## php configuration ## php configuration
# #
## uncomment if using php ## uncomment if using php
#export php_version='latest' export php_version='latest'

View File

@ -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 ## specify specific version from latest, 54, 55, 56, 70, 71, 72, 73 or 74
#export litespeed_version='latest' #export litespeed_version='latest'

View File

@ -1,5 +1,5 @@
## php configuration ## php configuration
# #
## uncomment if using php ## uncomment if using php
# php_version='latest' #export php_version='latest'

View File

@ -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 ## specify specific version from latest, 54, 55, 56, 70, 71, 72, 73 or 74
#export litespeed_version='latest' #export litespeed_version='latest'

View File

@ -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

View File

@ -1,3 +0,0 @@
#!/bin/sh

View File

@ -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

View File

@ -1,3 +0,0 @@
#!/bin/sh