| |
@@ -0,0 +1,80 @@
|
| |
+ #!/usr/bin/bash
|
| |
+ # vim:set ts=3:
|
| |
+
|
| |
+ HOSTPORT=5055
|
| |
+
|
| |
+ PODMANNS='fedoramagazine'
|
| |
+ DATABASE='wordpress_blog'
|
| |
+ USERNAME='wordpress'
|
| |
+ PASSWORD='chahL5oomaiHiezie8thei)h5'
|
| |
+
|
| |
+ set -e
|
| |
+
|
| |
+ rm -f cid-*
|
| |
+
|
| |
+ if ! [[ -e mariadb ]]; then
|
| |
+ mkdir mariadb
|
| |
+ fi
|
| |
+
|
| |
+ if ! [[ -e opt ]]; then
|
| |
+ mkdir opt
|
| |
+ curl -L -s --output-dir opt -o wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
| |
+ chmod +x opt/wp
|
| |
+ fi
|
| |
+
|
| |
+ function wordpress_stop {
|
| |
+ echo
|
| |
+ podman pod stop $PODMANNS
|
| |
+ }
|
| |
+
|
| |
+ trap wordpress_stop ERR PIPE EXIT HUP INT TERM
|
| |
+
|
| |
+ podman pod create \
|
| |
+ --name $PODMANNS \
|
| |
+ --replace \
|
| |
+ --infra \
|
| |
+ --network bridge \
|
| |
+ --publish $HOSTPORT:80
|
| |
+
|
| |
+ podman run \
|
| |
+ --pod $PODMANNS \
|
| |
+ --name mariadb \
|
| |
+ --cidfile cid-mariadb \
|
| |
+ --restart on-failure \
|
| |
+ --env MYSQL_DATABASE="$DATABASE" \
|
| |
+ --env MYSQL_USER="$USERNAME" \
|
| |
+ --env MYSQL_PASSWORD="$PASSWORD" \
|
| |
+ --env MYSQL_ROOT_PASSWORD='f3d0r4 m4g4z1n3' \
|
| |
+ --volume $PWD/mariadb:/var/lib/mysql:Z \
|
| |
+ --detach docker.io/library/mariadb
|
| |
+
|
| |
+ podman run \
|
| |
+ --pod $PODMANNS \
|
| |
+ --name wordpress \
|
| |
+ --cidfile cid-wordpress \
|
| |
+ --env WORDPRESS_DB_HOST="$PODMANNS" \
|
| |
+ --env WORDPRESS_DB_NAME="$DATABASE" \
|
| |
+ --env WORDPRESS_DB_USER="$USERNAME" \
|
| |
+ --env WORDPRESS_DB_PASSWORD="$PASSWORD" \
|
| |
+ --volume $PWD/opt:/opt:Z \
|
| |
+ --volume $PWD/fedoramagazine:/var/www/html/wp-content/themes/fedoramagazine:Z \
|
| |
+ --detach docker.io/library/wordpress
|
| |
+
|
| |
+ WP="podman exec wordpress /opt/wp --allow-root"
|
| |
+
|
| |
+ sleep 10
|
| |
+
|
| |
+ $WP core install \
|
| |
+ --url="localhost:$HOSTPORT" \
|
| |
+ --title='pants' \
|
| |
+ --admin_user='admin' \
|
| |
+ --admin_password='password' \
|
| |
+ --admin_email='null@fedoraproject.org' \
|
| |
+
|
| |
+ $WP theme activate fedoramagazine
|
| |
+ $WP plugin install yet-another-related-posts-plugin --activate
|
| |
+ $WP plugin install co-authors-plus --activate
|
| |
+
|
| |
+ echo "wordpress is listening on localhost:$HOSTPORT; press ctrl-c to stop"
|
| |
+ sleep infinity
|
| |
+
|
| |