Compare commits

..

3 Commits

Author SHA1 Message Date
jknapp
b2b3d284a6 Merge pull request 'Streamline WordPress Setup' (#2) from add-script into trunk
Reviewed-on: #2
2024-01-31 00:44:15 +00:00
b6fe0d77fd update script to setup the config 2024-01-30 16:40:42 -08:00
2e912bc4ab update script 2024-01-30 14:01:46 -08:00

View File

@ -57,7 +57,10 @@ chmod +x $root_path/instance_*
echo "Waiting 120 seconds for setup to finish" echo "Waiting 120 seconds for setup to finish"
sleep 120; sleep 120;
echo "Installing WordPress..." echo "Installing WordPress..."
docker exec $name bash -c "cd /home/$(whoami)/public_html; wp core download; chown -R $(whoami) /home/$(whoami)/public_html" wpdbuser=$(docker exec $name cat /var/lib/mysql/creds |grep User| awk -F ": " {'print $2'})
wpdbpass=$(docker exec $name cat /var/lib/mysql/creds |grep Password| awk -F ": " {'print $2'})
wpdb=$(docker exec $name cat /var/lib/mysql/creds |grep Database| awk -F ": " {'print $2'})
docker exec $name bash -c "cd /home/$(whoami)/public_html; wp core download; wp config create --dbname=$wpdb --dbuser=$wpdbuser --dbpass=$wpdbpass ; chown -R $(whoami):$(whoami) /home/$(whoami)/public_html;"
echo "Local Development Instance Created, to stop run ./instance_stop from within the base directory" echo "Local Development Instance Created, to stop run ./instance_stop from within the base directory"
echo "MySQL DB Credentials" echo "MySQL DB Credentials"
docker exec $name cat /var/lib/mysql/creds docker exec $name cat /var/lib/mysql/creds