initial commit

This commit is contained in:
2023-12-16 17:23:18 -06:00
commit 0df4f8540d
16 changed files with 254 additions and 0 deletions

8
chihounds/.env.sample Normal file
View File

@@ -0,0 +1,8 @@
WORDPRESS_TITLE=
WORDPRESS_SITEURL=
WORDPRESS_HOME=
WORDPRESS_DB_NAME=
WP_THEMES=
WP_PLUGINS=

4
chihounds/docker-run.sh Executable file
View File

@@ -0,0 +1,4 @@
cd "$(dirname "$0")"
PROJECT_NAME=kenesaw
CONTAINER_NAME=chihounds
docker run --rm --user 33:33 --volume ${PROJECT_NAME}_${CONTAINER_NAME}-wpdata:/var/www/html --env-file ../.env --env-file .env --network ${PROJECT_NAME}_network "$@"

2
chihounds/wp-cli.sh Executable file
View File

@@ -0,0 +1,2 @@
cd "$(dirname "$0")"
./docker-run.sh wordpress:cli "$@"

27
chihounds/wp-import.sh Executable file
View File

@@ -0,0 +1,27 @@
cd "$(dirname "$0")"
./docker-run.sh \
-v ./data/import.sql:/import.sql \
-v ./data/import-uploads.tgz:/import-uploads.tgz \
wordpress:cli sh -c '
if [ -f /import.sql ]; then
echo "Importing Database..."
wp db query < /import.sql
echo "Replacing default site url (https://localhost->$WORDPRESS_SITEURL)"
wp search-replace "https://localhost" "$WORDPRESS_SITEURL" --format=count
echo "Re-adding the admin user"
wp user create $WORDPRESS_ADMIN_USER $WORDPRESS_ADMIN_EMAIL --user_pass=$WORDPRESS_ADMIN_PASSWORD --role=administrator --porcelain
echo "Done."
fi && \
if [ -f /import-uploads.tgz ]; then
echo "Importing Uploads..."
tar -xz --overwrite -f /import-uploads.tgz -C /var/www/html/wp-content/uploads .
echo "Done."
fi && \
if [ -f /import-plugins.tgz ]; then
echo "Importing Plugins..."
tar -xzk--overwrite -f /import-plugins.tgz -C /var/www/html/wp-content/plugins .
echo "Done."
fi
'

7
chihounds/wp-install.sh Executable file
View File

@@ -0,0 +1,7 @@
cd "$(dirname "$0")"
./wp-cli.sh sh -c '
wp db create || true && \
wp core install --title="$WORDPRESS_TITLE" --url="$WORDPRESS_SITEURL" --admin_user=$WORDPRESS_ADMIN_USER --admin_email=$WORDPRESS_ADMIN_EMAIL --admin_password=$WORDPRESS_ADMIN_PASSWORD && \
wp theme install $WP_THEMES --activate; \
wp plugin install $WP_PLUGINS --activate
'