This repository contains scripts to help you setup a development environment for PublishPress plugins.
-
Add the repository as a subtree to your project, inside the
./dev-workspace/
folder with prefixsrc
:git subtree add --prefix=dev-workspace/src https://github.com/publishpress/dev-workspaces.git main
-
Create a
./dev-workspace/.env
file as a copy of./dev-workspace/src/.env.example
and fill in the variables.cp ./dev-workspace/src/.env.example ./dev-workspace/.env
-
Create a
./dev-workspace/exec
file as a copy of./dev-workspace/src/exec.example
.cp ./dev-workspace/src/exec.example ./dev-workspace/exec
-
Make the
./dev-workspace/exec
file executable.chmod +x ./dev-workspace/exec
-
Run the
./dev-workspace/exec
file to check it is working../dev-workspace/exec
You should see the following output:
Usage: ./src/bin/exec [run|update|build|build-push]
Commands:
- run: Run the dev-workspace container
- update: Update the docker image for the dev-workspace container
- build: Build the docker image
- build-push: Build and push the docker image to the registry
To update the subtree, run the following command:
git subtree pull --prefix=dev-workspace/src https://github.com/publishpress/dev-workspaces.git main --squash
To run the dev-workspace container, run the following command:
./dev-workspace/exec run
To update the dev-workspace container, run the following command:
./dev-workspace/exec update
To build the dev-workspace container, run the following command:
./dev-workspace/exec build
To build and push the dev-workspace container, run the following command:
./dev-workspace/exec build-push