#33 Avoid redownload and reinstalling things when possible
Merged 2 years ago by glb. Opened 2 years ago by glb.
glb/fedoramagazine-theme optimize  into  master

file modified
+1
@@ -1,4 +1,5 @@ 

  .vagrant

  /cid-*

  /opt

+ /srv

  /mariadb

file modified
+28 -9
@@ -8,6 +8,8 @@ 

  USERNAME='wordpress'

  PASSWORD='chahL5oomaiHiezie8thei)h5'

  

+ WPPLUGIN='yet-another-related-posts-plugin co-authors-plus'

+ 

  set -e

  

  rm -f cid-*
@@ -22,6 +24,13 @@ 

  	chmod +x opt/wp

  fi

  

+ if ! [[ -e srv ]]; then

+ 	mkdir srv

+ 	for plugin in $WPPLUGIN; do

+ 		curl -L -s --output-dir srv -O https://downloads.wordpress.org/plugin/$plugin.zip

+ 	done

+ fi

+ 

  function wordpress_stop {

  	echo

  	podman pod stop $PODMANNS
@@ -57,6 +66,7 @@ 

  	--env WORDPRESS_DB_USER="$USERNAME" \

  	--env WORDPRESS_DB_PASSWORD="$PASSWORD" \

  	--volume $PWD/opt:/opt:Z \

+ 	--volume $PWD/srv:/srv:Z \

  	--volume $PWD/fedoramagazine:/var/www/html/wp-content/themes/fedoramagazine:Z \

  	--detach docker.io/library/wordpress

  
@@ -64,16 +74,25 @@ 

  

  sleep 10

  

- $WP core install \

- 	--url="localhost:$HOSTPORT" \

- 	--title='pants' \

- 	--admin_user='admin' \

- 	--admin_password='password' \

- 	--admin_email='null@fedoraproject.org' \

+ if ! $WP core is-installed; then

+ 	$WP core install \

+ 		--url="localhost:$HOSTPORT" \

+ 		--title='pants' \

+ 		--admin_user='admin' \

+ 		--admin_password='password' \

+ 		--admin_email='null@fedoraproject.org' \

+ 

+ fi

+ 

+ if ! $WP theme is-active fedoramagazine; then

+ 	$WP theme activate fedoramagazine

+ fi

  

- $WP theme activate fedoramagazine

- $WP plugin install yet-another-related-posts-plugin --activate

- $WP plugin install co-authors-plus --activate

+ for plugin in $WPPLUGIN; do

+ 	if ! $WP plugin is-installed $plugin; then

+ 		$WP plugin install /srv/$plugin.zip --activate

+ 	fi

+ done

  

  echo "wordpress is listening on http://localhost:$HOSTPORT/; press ctrl-c to stop"

  sleep infinity

no initial comment

Pull-Request has been merged by glb

2 years ago
Metadata