forked from wpengine/site-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e928c6
commit 8ef13c7
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.PHONY: clean list-images build publish | ||
|
||
IMAGE_NAME ?= wpengine/site-deploy | ||
MAJOR_VERSION ?= 1 | ||
MINOR_VERSION ?= 0 | ||
PATCH_VERSION ?= 0 | ||
TAG ?= latest | ||
IMAGE := $(IMAGE_NAME):$(TAG) | ||
|
||
clean: | ||
$(eval CURRENT_IMAGES=`docker images $(IMAGE_NAME) -a -q | uniq`) | ||
docker rmi -f $(CURRENT_IMAGES) | ||
|
||
list-images: | ||
docker images $(IMAGE_NAME) -a | ||
|
||
build: | ||
docker build --no-cache -t $(IMAGE) ./ | ||
|
||
version: build | ||
docker image tag $(IMAGE) $(IMAGE_NAME):v$(MAJOR_VERSION) && \ | ||
docker image tag $(IMAGE) $(IMAGE_NAME):v$(MAJOR_VERSION).$(MINOR_VERSION) && \ | ||
docker image tag $(IMAGE) $(IMAGE_NAME):v$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,47 @@ | ||
# site-deploy | ||
# wpengine/site-deploy | ||
Base image to build VCS integrations enabling customers to deploy their site to WP Engine | ||
|
||
## How to Build | ||
|
||
You can build and version this image using make targets. | ||
|
||
```sh | ||
make build # Builds the image locally | ||
make version # Builds the image and creates version tags | ||
make list-images # Shows all tagged versions of the image | ||
make clean # Deletes all tagged versions of the image | ||
``` | ||
|
||
## How to Run | ||
|
||
You can use this image to deploy a site from your local machine. | ||
|
||
1. Build the `wpengine/site-deploy:latest` image with `make build`. | ||
2. Change directories into the root of the local site you'd like to deploy. | ||
3. Create a `.env` file with the following variables, changing their values as needed. | ||
|
||
```sh | ||
INPUT_WPE_ENV=yourinstall # The target WP Engine install name. | ||
GITHUB_REF=main # Inconsequential, but must be defined for now. | ||
INPUT_REMOTE_PATH= | ||
INPUT_SRC_PATH=. | ||
INPUT_PHP_LINT=TRUE | ||
INPUT_CACHE_CLEAR=TRUE | ||
``` | ||
|
||
3. Set an environment variable with your private SSH key, replacing the key file name with your own. | ||
|
||
```sh | ||
export INPUT_WPE_SSHG_KEY_PRIVATE=`cat ~/.ssh/my_sshg_key_rsa` | ||
``` | ||
4. Replace `/path/to/your/install` with the absolute path to your local site and run the deploy! | ||
|
||
```sh | ||
docker run \ | ||
-e "INPUT_WPE_SSHG_KEY_PRIVATE" \ | ||
-e "INPUT_FLAGS=-azvr --inplace --exclude=\".*\"" \ | ||
--env-file ./.env \ | ||
-v /path/to/your/install:/site \ | ||
--workdir=/site \ | ||
wpengine/site-deploy:latest | ||
``` |