From a93776103db275bb8f11daa592936c8ed59ae721 Mon Sep 17 00:00:00 2001 From: Jason DeWitt Date: Wed, 27 Apr 2016 16:18:54 -0500 Subject: [PATCH 1/3] fixed contitionals in perstart.sh for WORDPRESS_ACTIVE_THEME and WORDPRESS_TEST_DATA updating setup.sh to use nginx CNS url for WordPress URL --- bin/prestart.sh | 5 +++-- setup.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/prestart.sh b/bin/prestart.sh index d6df9fc..668b2d8 100755 --- a/bin/prestart.sh +++ b/bin/prestart.sh @@ -47,18 +47,19 @@ else # set a nice default permalink structure wp --allow-root option update permalink_structure '/%year%/%monthnum%/%postname%/' # set theme - if [ $WORDPRESS_ACTIVE_THEME ] + if [ -n $WORDPRESS_ACTIVE_THEME ] then wp --allow-root theme activate $WORDPRESS_ACTIVE_THEME fi - if [ $WORDPRESS_TEST_DATA ] + if [[ $WORDPRESS_TEST_DATA=true ]] then echo "installing WP test content" wp --allow-root plugin install wordpress-importer --activate curl -OL https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml wp --allow-root import wptest.xml --authors=create wp --allow-root plugin uninstall wordpress-importer --deactivate + chown www-data:www-data /var/www/html/wordpress/content/uploads/* rm wptest.xml fi fi diff --git a/setup.sh b/setup.sh index d762e1a..6689fc0 100755 --- a/setup.sh +++ b/setup.sh @@ -116,7 +116,7 @@ envcheck() { echo '# Environment variables for for WordPress site' > _env echo '# please include the scheme http:// or https:// in the URL variable' >> _env - echo 'WORDPRESS_URL=http://'wordpress.svc.${TRITON_ACCOUNT}.${TRITON_DC}.triton.zone >> _env + echo 'WORDPRESS_URL=http://'nginx.svc.${TRITON_ACCOUNT}.${TRITON_DC}.triton.zone >> _env echo 'WORDPRESS_SITE_TITLE=Autopilot Pattern WordPress test site' >> _env echo 'WORDPRESS_ADMIN_EMAIL=user@example.net' >> _env echo 'WORDPRESS_ADMIN_USER=admin-'$(cat /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9' | head -c 3) >> _env From 176d89e685b6dee0b331b49ba4547b425ef2f9c7 Mon Sep 17 00:00:00 2001 From: Jason DeWitt Date: Wed, 27 Apr 2016 16:23:36 -0500 Subject: [PATCH 2/3] fixing perms on uploads after test data import --- bin/prestart.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/prestart.sh b/bin/prestart.sh index 668b2d8..3f6661f 100755 --- a/bin/prestart.sh +++ b/bin/prestart.sh @@ -59,7 +59,7 @@ else curl -OL https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml wp --allow-root import wptest.xml --authors=create wp --allow-root plugin uninstall wordpress-importer --deactivate - chown www-data:www-data /var/www/html/wordpress/content/uploads/* + chown -R www-data:www-data /var/www/html/wordpress/content/uploads/* rm wptest.xml fi fi From 6344c3e615c58fd0b87eaeb684e828c142676b89 Mon Sep 17 00:00:00 2001 From: Jason DeWitt Date: Wed, 27 Apr 2016 17:27:06 -0500 Subject: [PATCH 3/3] quoting the var --- bin/prestart.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/prestart.sh b/bin/prestart.sh index 3f6661f..2632458 100755 --- a/bin/prestart.sh +++ b/bin/prestart.sh @@ -47,7 +47,7 @@ else # set a nice default permalink structure wp --allow-root option update permalink_structure '/%year%/%monthnum%/%postname%/' # set theme - if [ -n $WORDPRESS_ACTIVE_THEME ] + if [ -n "$WORDPRESS_ACTIVE_THEME" ] then wp --allow-root theme activate $WORDPRESS_ACTIVE_THEME fi