Giter VIP home page Giter VIP logo

devbox-gutenberg's Introduction

Devbox for Gutenberg hacking

This runs WordPress instances for developing and testing Gutenberg like the project’s own wp-env setup but without needing to run Docker.

This doesn’t include the Gutenberg repo itself. It’s expected to provide the path of a local cloned repo to the script setup_wpin the env variable GUTENBERG_REPO.

Given devbox is installed (see Getting Started) to ready the environment run:

devbox services up -b
devbox run setup_db

Then set up the WP instances and provide the path to the gutenberg repo either in the command:

devbox run --env GUTENBERG_REPO=/yer/gutenberg setup_wp

Or through an env file:

devbox run --env-file .env.devbox setup_wp

Example env file:

GUTENBERG_REPO=/yer/gutenberg
# wp cli is used and you may wish to control its cache directory:
WP_CLI_CACHE_DIR=/yer/Library/Caches

That should be it 🍾.

Development Status

It’s mostly working. Not all e2e tests pass but the vast majority do.

Getting Started

This project uses devbox to manage its development environment.

Install devbox:

curl -fsSL https://get.jetpack.io/devbox | bash

Start the devbox shell:

devbox shell

Run a script in the devbox environment:

devbox run <script>

Scripts

Scripts are custom commands that can be run using this project's environment. This project has the following scripts:

Environment

GUTENBERG_REPO="~/Repos/gutenberg"
MYSQL_BASEDIR="/Users/m/Repos/devbox-gutenberg/.devbox/nix/profile/default"
MYSQL_DATADIR="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/mysql80/data"
MYSQL_HOME="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/mysql80/run"
MYSQL_PID_FILE="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/mysql80/run/mysql.pid"
MYSQL_UNIX_PORT="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/mysql80/run/mysql.sock"
NGINX_CONF="/Users/m/Repos/devbox-gutenberg/devbox.d/nginx/nginx.conf"
NGINX_CONFDIR="/Users/m/Repos/devbox-gutenberg/devbox.d/nginx"
NGINX_DEV_PORT="8888"
NGINX_DEV_ROOT="../../../devbox.d/web/dev-wp"
NGINX_PATH_PREFIX="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/nginx"
NGINX_TEST_PORT="8889"
NGINX_TEST_ROOT="../../../devbox.d/web/test-wp"
NGINX_TMPDIR="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/nginx/temp"
NGINX_WEB_PORT="80"
NGINX_WEB_ROOT="../../../devbox.d/web"
NGINX_WEB_SERVER_NAME="localhost"
PHPFPM_ERROR_LOG_FILE="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/php/php-fpm.log"
PHPFPM_PID_FILE="/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/php/php-fpm.pid"
PHPFPM_PORT="8082"
PHPRC="/Users/m/Repos/devbox-gutenberg/devbox.d/php"
WP_CLI_CACHE_DIR="~/Library/Caches"

Shell Init Hook

The Shell Init Hook is a script that runs whenever the devbox environment is instantiated. It runs on devbox shell and on devbox run.

bash /Users/m/Repos/devbox-gutenberg/.devbox/virtenv/mysql80/setup_db.sh
echo 'Welcome to devbox!' > /dev/null

Packages

  • path:/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/php/flake
  • path:/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/php/flake#composer
  • gettext@latest
  • gawk@latest
  • path:/Users/m/Repos/devbox-gutenberg/.devbox/virtenv/mysql80/flake
  • nginx@latest
  • wp-cli@latest

Script Details

devbox run setup_db

mysql -u root < setup_db.sql

devbox run setup_wp

./setup_wp.sh

devbox run test

echo "Error: no test specified" && exit 1

devbox-gutenberg's People

Contributors

stokesman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.