Skip to content

Commit

Permalink
Prepare for release (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
apmatthews authored Dec 15, 2022
1 parent 40ff7fe commit 8607207
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
10 changes: 4 additions & 6 deletions .changeset/swift-maps-grab.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@
"@wpengine/site-deploy": major
---

# Refactor the Main Script
Updates the main script to be more generic, allowing it to be used around different CI/CD Vendors.

Updates the main script to be more generic and allow the script and image to be used around other CI/CD Vendors.

In order to use this script, each CI/CD vendor will need to set the environment variables accordingly:
In order to use this image, each CI/CD vendor implementation will need to set the environment variables accordingly:

```sh
WPE_ENV # The target WP Engine install name
REMOTE_PATH # Default is empty
SRC_PATH # Default is the current directory
FLAGS # Default is -azvr --inplace --exclude=".*"
PHP_LINT # Default is "FALSE"
CACHE_CLEAR # Default is "TRUE"
SCRIPT # Default is empty
CICD_VENDOR # Default is "wpe-cicd"
```

Example of how to run this image:

```sh
docker run \
docker run --rm \
-e "WPE_SSHG_KEY_PRIVATE" \
--env-file ./.env \
-v <full_path_of_site>:/site \
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.env
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,25 @@ You can use this image to deploy a site from your local machine.

```sh
WPE_ENV=yourinstall # The target WP Engine install name.
GIT_REF=main # Inconsequential, but must be defined for now.
REMOTE_PATH=
SRC_PATH=.
PHP_LINT=TRUE
CACHE_CLEAR=TRUE
SCRIPT=
```

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`
export 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!
4. Run the deploy!

```sh
docker run \
-e "INPUT_WPE_SSHG_KEY_PRIVATE" \
-e "INPUT_FLAGS=-azvr --inplace --exclude=\".*\"" \
docker run --rm \
-e "WPE_SSHG_KEY_PRIVATE" \
--env-file ./.env \
-v /Users/marcos.schratzenstaller/workspace/wpe/qpdnpsx22q:/site \
-v $(pwd):/site \
--workdir=/site \
wpengine/site-deploy:latest
```

0 comments on commit 8607207

Please sign in to comment.