-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/add symlink and sql flows #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
leglesslizard
wants to merge
42
commits into
main
Choose a base branch
from
feature/add-symlink-and-sql-flows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
dbcc5aa
updated readme
leglesslizard d22a206
added new atomic deploy workflow
leglesslizard f249808
added migrate flow
leglesslizard 305f233
add swap and migrate action
leglesslizard 09ea1d0
added swap script
leglesslizard cd492f3
added notification settings on error
leglesslizard f0fd384
added migration action
leglesslizard 970a910
migrate script added
leglesslizard 4edf6e1
updated readme
leglesslizard 4d653b3
only leave maintenance mode active if live actions fail
leglesslizard 5fcce96
updated readme
leglesslizard 1443086
fix wildcard call potentially targeting incorrect tables
leglesslizard ca1e0f6
validate paths early to avoid potential desync on symlinks
leglesslizard 0d96206
protect SQL by escaping filenames
leglesslizard f4fc816
escape vars before running remote actions
leglesslizard 416d5cd
more specific error checking for notifications
leglesslizard 121c453
update commands in notification email
leglesslizard ec385e2
updated readme
leglesslizard 032fbce
update action to use absolute paths
leglesslizard f9b5901
make workflows queue not race
leglesslizard 23cf4f0
updated comment
leglesslizard 728a804
safeguard swap script
leglesslizard 763c1e9
update readme
leglesslizard 9e17cd8
added logic to prevent additive prefixes
leglesslizard 0ab9093
avoid whitespace issues with release directories
leglesslizard 3c7e479
updated comments
leglesslizard b2c96e3
add robust check for absolute paths
leglesslizard 7bba305
centralise migrate scripts
leglesslizard bebf68f
more robust checks
leglesslizard f9c1741
minor fixes
leglesslizard befc17e
updated branch refs for testing
leglesslizard 355a8af
mkdir if not exists and update branch refs
leglesslizard 505cec0
updated passable releases dir
leglesslizard 3fd5dae
remove redundant chmos
leglesslizard 92ef559
use short sha
leglesslizard 17be130
fix prefix custom table
leglesslizard d3da835
update drop command
leglesslizard d03bddf
update wp db prefix for user caps
leglesslizard 54eef11
changed symlinks to mv
leglesslizard 31f5107
update scripts
leglesslizard d1d8210
updated readme
leglesslizard 21f8d6f
Potential fix for pull request finding
leglesslizard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,83 @@ | ||
| name: Atomic Deploy | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| ssh-host: | ||
| type: string | ||
| description: "SSH host to connect to" | ||
| required: true | ||
| ssh-user: | ||
| type: string | ||
| description: "SSH user to connect with" | ||
| required: false | ||
| default: piecode | ||
| ssh-port: | ||
| type: number | ||
| description: "SSH port to connect to" | ||
| required: false | ||
| default: 22 | ||
| wp-root: | ||
| type: string | ||
| description: "Absolute path to the WordPress root on the remote server (must start with /)" | ||
| required: true | ||
| components: | ||
| type: string | ||
| description: "Newline-separated list of components to deploy, one per line in type:name format (e.g. plugins:my-plugin)" | ||
| required: true | ||
| releases-dir: | ||
| type: string | ||
| description: "Absolute path to the releases directory on the server. Defaults to a 'releases' sibling of wp-root when not set." | ||
| required: false | ||
| default: "" | ||
| secrets: | ||
| SSH_PRIVATE_KEY: | ||
| description: "SSH private key" | ||
| required: true | ||
| SMTP_SERVER: | ||
| description: "SMTP server for failure notifications" | ||
| required: false | ||
| SMTP_USERNAME: | ||
| description: "SMTP username" | ||
| required: false | ||
| SMTP_PASSWORD: | ||
| description: "SMTP password" | ||
| required: false | ||
| NOTIFY_EMAIL: | ||
| description: "Override recipient email (defaults to #uptime_alerts Slack channel)" | ||
| required: false | ||
|
|
||
| concurrency: | ||
| group: atomic-deploy-${{ inputs.ssh-host }}-${{ inputs.wp-root }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| atomic_deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - name: Compute short SHA | ||
| id: sha | ||
| shell: bash | ||
| run: echo "short_sha=${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: pie/.github/actions/add-ssh-config@feature/add-symlink-and-sql-flows | ||
|
leglesslizard marked this conversation as resolved.
|
||
| name: Add SSH key to runner | ||
| with: | ||
| ssh-user: ${{inputs.ssh-user}} | ||
| ssh-port: ${{inputs.ssh-port}} | ||
| ssh-host: ${{inputs.ssh-host}} | ||
| ssh-key: ${{secrets.SSH_PRIVATE_KEY}} | ||
|
|
||
| - uses: pie/.github/actions/swap-and-migrate@feature/add-symlink-and-sql-flows | ||
|
leglesslizard marked this conversation as resolved.
|
||
| name: Run atomic swap and migrations | ||
| with: | ||
| wp-root: ${{inputs.wp-root}} | ||
| git-sha: ${{ steps.sha.outputs.short_sha }} | ||
| repo-name: ${{github.event.repository.name}} | ||
| components: ${{inputs.components}} | ||
| releases-dir: ${{inputs.releases-dir}} | ||
| notify-email: ${{secrets.NOTIFY_EMAIL || 'uptime_alerts-aaaaabagrbjrarifmw25mquney@piecode.slack.com'}} | ||
| smtp-server: ${{secrets.SMTP_SERVER}} | ||
| smtp-username: ${{secrets.SMTP_USERNAME}} | ||
| smtp-password: ${{secrets.SMTP_PASSWORD}} | ||
This file contains hidden or 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
This file contains hidden or 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,18 @@ | ||
| name: Setup | ||
|
|
||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| short-sha: | ||
| description: "Short (8-character) git commit SHA for use in release directory paths" | ||
| value: ${{ jobs.setup.outputs.short_sha }} | ||
|
|
||
| jobs: | ||
| setup: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| short_sha: ${{ steps.sha.outputs.short_sha }} | ||
| steps: | ||
| - id: sha | ||
| shell: bash | ||
| run: echo "short_sha=${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.