Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
/ vip-dev-env Public archive

PoC of a new model for the WordPress VIP dev environment based almost completely on containers.

Notifications You must be signed in to change notification settings

Automattic/vip-dev-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dev environment with containers

==============================

THIS REPO IS BEING DEPRECATED.

Please use https://docs.wpvip.com/technical-references/vip-local-development-environment/ instead.

==============================

This is a PoC of a new model for the dev environment based almost completely on containers.

It also integrates the ideas of multi-instance support from Automattic/vip-go-mu-dev#32

Creating an instance

After installing dependencies with npm install, you can create a new instance with:

./vipdev.js create <slug>

This will create the directory site-<slug> where the final .lando.yml file will be located.

You can set several parameters to tune the instance, e.g:

./vipdev.js create testing \
  --title "Site Title" \
  --php 7.3 \
  --wordpress 5.5.1 \
  --mu-plugins /home/code/vip-go-mu-plugins \
  --client-code /home/code/vip-wordpress-com

As you can see, you can choose to use your local clone of mu-plugins in case you want to develop on it (by default it will use a container that auto updates the repo). You can also choose the local path to the client code (by default it will use the vip-go-skeleton container).

You can also fetch all required data using the site id:

./vipdev.js create wpvip --site 1513

This will obtain the PHP and WordPress version from GOOP, and it will clone the git repo with the client code, putting it in site-wpvip/clientcode

Upgrading an instance

After an instance has been created, you can upgrade some of its components. E.g:

./vipdev.js upgrade testing \
  --php 7.4 \
  --wordpress 5.5.1 \
  --mu-plugins auto

This will rebuild the app containers but without losing any data.

Common use cases

NOTE: Default wp-admin credentials are vipgo:password

MU-plugins DEV

When you want to have basic site that is using your local mu-plugins code checkout similar to what previous vip-go-mu-dev environment used to do:

./vipdev.js create <env-name> --mu-plugins <mu-plugins-absolute-path>

MU-plugins DEV multisite (-m)

./vipdev.js create <env-name> -m --mu-plugins <mu-plugins-absolute-path>

To add sites:

cd dev-<env-name>
lando add-site --slug=test --title="Test"

To-Do

There are a few things that are needed before matching the functionalities of the current lando environment in mu-dev:

  • Multisite support [DONE]
  • Cron control
  • Mu-plugins tests

Container definitions

In the directory docker you can find the Dockerfiles for all containers used in this environment. They are pushed to the organization wpvipdev in dockerhub (all of them are based on open source projects, so they can be public).

If you need to change anything on the docker images:

  1. Adapt the Dockerfile and/or the scripts or config files
  2. Bump the tag version in the corresponding build.sh script
  3. Run sh build.sh, it will build the new docker image locally
  4. Bump the required version in .lando.yml.ejs (but don't commit yet)
  5. Test it in your local dev environment
  6. Once you are happy with it, you can push the image to dockerhub using the script tools/push-public.sh in the vip-docker repo, so it can be made available to any other user
  7. Commit/Push/PR your changes to .lando.yml.ejs so the new docker images requirements are distributed

About

PoC of a new model for the WordPress VIP dev environment based almost completely on containers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages