Skip to content

Commit

Permalink
Add support for custom local branch names
Browse files Browse the repository at this point in the history
jovrtn committed Apr 10, 2019

Verified

This commit was signed with the committer’s verified signature.
jovrtn Jesse L.K. Overton
1 parent 80e09b6 commit 78e43d6
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ action "Git Push to Production" {
| Name | Type | Usage |
|-|-|-|
| `WPENGINE_ENVIRONMENT` | Environment Variable | Defaults to `production`. You shouldn't need to change this, but if you're using WP Engine's legacy staging, you can override the default and set to `staging` if needed. |
| `LOCAL_BRANCH` | Environment Variable | Set which branch in your repository you'd like to push to WP Engine. Defaults to `master`. |

### Further reading

4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@ WPENGINE_SSH_KEY_PRIVATE_PATH="$SSH_PATH/wpengine_key"
WPENGINE_SSH_KEY_PUBLIC_PATH="$SSH_PATH/wpengine_key.pub"
WPENGINE_ENVIRONMENT_DEFAULT="production"
WPENGINE_ENV=${WPENGINE_ENVIRONMENT:-$WPENGINE_ENVIRONMENT_DEFAULT}
LOCAL_BRANCH_DEFAULT="master"
BRANCH=${LOCAL_BRANCH:-$LOCAL_BRANCH_DEFAULT}

mkdir "$SSH_PATH"

@@ -28,4 +30,4 @@ chmod 644 "$WPENGINE_SSH_KEY_PUBLIC_PATH"

git config core.sshCommand "ssh -i $WPENGINE_SSH_KEY_PRIVATE_PATH -o UserKnownHostsFile=$KNOWN_HOSTS_PATH"
git remote add $WPENGINE_ENV git@$WPENGINE_HOST:$WPENGINE_ENV/$WPENGINE_ENVIRONMENT_NAME.git
git push -fu $WPENGINE_ENV master
git push -fu $WPENGINE_ENV $BRANCH:master

0 comments on commit 78e43d6

Please sign in to comment.