Skip to content

Commit

Permalink
Merge pull request #35 from dokku/trace-mode
Browse files Browse the repository at this point in the history
Add TRACE mode for debugging
  • Loading branch information
josegonzalez authored Dec 1, 2022
2 parents 88b90f0 + 7055bc6 commit 0628697
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Please note that this action is compatible with `dokku >= 0.11.6`.
-----END OPENSSH PRIVATE KEY-----
```

- `trace`: (_optional_) Allows users to debug what the action is performing by enabling shell trace mode
- example value: `1`

## Examples

All examples below are functionally complete and can be copy-pasted into a `.github/workflows/deploy.yaml` file, with some minor caveats:
Expand All @@ -76,7 +79,7 @@ For simplicity, each example is standalone, but may be combined as necessary to

The `SSH_HOST_KEY` value can be retrieved by calling `ssh-keyscan -t rsa $HOST`, where `$HOST` is the Dokku server's hostname.
- [Specify a custom deploy branch](/example-workflows/custom-deploy-branch.yml): Certain Dokku installations may use custom deploy branches other than `master`. In the following example, we push to the `develop` branch.
- [Verbose Push Logging](/example-workflows/verbose-logging.yml): Verbose client-side logging may be enabled with this method. Note that this does not enable trace mode on the deploy, and simply tells the `git` client to enable verbose log output
- [Verbose Push Logging](/example-workflows/verbose-logging.yml): Verbose client-side logging may be enabled with this method, as well as trace mode for all shell command output. Note that this does not enable trace mode on the remote deploy, and simply tells the `git` client to enable verbose log output.
- [Force Pushing](/example-workflows/force-push.yml): If the remote app has been previously pushed manually from a location other than CI, it may be necessary to enable force pushing to avoid git errors.
- [Review Apps](/example-workflows/review-app.yml): Handles creation and deletion of review apps through use of `dokku apps:clone` and `dokku apps:destroy`. Review apps are a great way to allow folks to preview pull request changes before they get merged to production.
- Placing a shell script at `bin/ci-pre-deploy` can be used to reconfigure the app, as shown in [this example](/example-workflows/review-app/ci-pre-deploy).
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ inputs:
ssh_private_key:
description: "A private SSH key that has push acces to your Dokku instance"
required: true
trace:
description: "Allows users to debug what the action is performing by enabling shell trace mode"
required: false
default: ""
runs:
using: "docker"
image: "Dockerfile"
Expand All @@ -71,3 +75,4 @@ runs:
REVIEW_APP_NAME: ${{ inputs.review_app_name }}
SSH_HOST_KEY: ${{ inputs.ssh_host_key }}
SSH_PRIVATE_KEY: ${{ inputs.ssh_private_key }}
TRACE: ${{ inputs.trace }}
2 changes: 2 additions & 0 deletions example-workflows/verbose-logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ jobs:
git_push_flags: '-vvv'
git_remote_url: 'ssh://dokku@dokku.me:22/appname'
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
# enable shell trace mode
trace: '1'

0 comments on commit 0628697

Please sign in to comment.