This post was inspired by post of other user. In result I have created a bash script which can be used to automate creation of wordpress site on development machine.

If you like to play with bash and automate your life this is something for you.

To generate a website all you need to do is to run the script from terminal, provide project name and decide if you want to download fresh resources from the web or use the one you have already downloaded previously.

I assume that you have wp-cli (wp-cli.phar), wget, or curll, git-bash (or other linux like terminal – cmder) installed or you will be capable of installing them on to your machine and run it. If you need a hand with installing wp-cli.phar read this short tutorial – Install WP-CLI on Windows 10

Download and modify the shell script

Next download the script from the github DevWL/installwpsh.

You need to place installwp.sh bash script in C:\laragon\www once you do that navigate to termianl cd /c/laragon/www and bash installwp.sh. Just remember to edit email address of your file and change mysql credentials if required.

Now generating a new site takes me about 10s. Just bear in mind that I did change default Laragons configuration. I replaced .test with .dv and I did enable SSL. Emails are stored by default in laragon\bin\sendmail\output. So even if you did not notice _dv_login.txt tekst file generated in every project you can “email” the reset pass to your output log that I have shown you before.

Share your local dev site with client

During the development you can showcase your work using build in laragon share future, which allow your customer to access locally developed site using external URL.

Copy the Forwarding URL and sent it to your customer!

Migrate your dev site to prod server

After your website is ready to go you can ship the to prod server. Install BackWpUp and Better String Replace wp plugins which will allow you to move site of any size without any limitations.

The above setup will take care of string replace (domain name) in serialized data.

Another WordPress development automation setup.

Alternatively, you can use composer with Bedrock and wpackagist.org repository to install any plugins in a composer defined version. See wordpress-developer-way-of-managing-plugins-on-the-site

For fast local development/ dev env setup, you can use Local by FlyWheel.

Also nothing stopping you to use wp-cli to make all necessary site creation and setting configuration from a cli.

https://github.com/DevWL/installwpsh/blob/main/installwp.sh

0
Would love your thoughts, please comment.x
()
x