feat(cli): add client-side preActivate/postActivate activation hooks#384
Open
n-hass wants to merge 1 commit into
Open
feat(cli): add client-side preActivate/postActivate activation hooks#384n-hass wants to merge 1 commit into
n-hass wants to merge 1 commit into
Conversation
Add two optional, generic settings (per profile / node / top-level),
`preActivate` and `postActivate`, that run a command on the deploying
host
around profile activation:
* preActivate runs after the closure is pushed, before activation; a
non-zero exit aborts the deploy before anything is activated.
* postActivate runs after activation, on success OR failure
Both are skipped for --dry-activate. The command runs via `sh -c` with
the
deploy/SSH context exported as environment variables, so it can act on
the
target over the same connection deploy-rs uses:
DEPLOY_RS_HOOK, DEPLOY_RS_SSH_ADDR, DEPLOY_RS_SSH_USER,
DEPLOY_RS_HOSTNAME,
DEPLOY_RS_SSH_OPTS, DEPLOY_RS_SUDO, DEPLOY_RS_PROFILE_PATH,
DEPLOY_RS_NODE,
DEPLOY_RS_PROFILE, DEPLOY_RS_BOOT
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add two optional, generic settings (per profile / node / top-level),
preActivateandpostActivate, that run a command on the deploying host around profile activation:preActivateruns after the closure is pushed, before activation is started. A non-zero exit code aborts the deploy before activation.postActivateruns after activation, on success OR failureBoth are skipped for
--dry-activate. The command runs viash -cwith the deploy/SSH context exported as environment variables, so it can act on the target if required:DEPLOY_RS_HOOK: Which hook is running. Values:pre-activateorpost-activate.DEPLOY_RS_SSH_ADDR: SSH target in user@host form ("{DEPLOY_RS_SSH_USER}@{DEPLOY_RS_HOSTNAME}"), egroot@server.example.com.DEPLOY_RS_SSH_USER: The SSH user deploy-rs connects as (resolved from profile/node settings).DEPLOY_RS_HOSTNAME: The host being deployed to. The--hostnameCLI override if given, otherwise the node's configured hostname.DEPLOY_RS_SSH_OPTS: Extra SSH options deploy-rs uses (merged ssh_opts joined by spaces; empty string if none).DEPLOY_RS_SUDO: The sudo command prefix (egsudo -u user), or empty string if sudo isn't used.DEPLOY_RS_PROFILE_PATH: Nix store path of the profile being activated (/nix/store/...).DEPLOY_RS_NODE: Name of the node being deployed from the deploy config.DEPLOY_RS_PROFILE: Name of the profile being deployed from the deploy config.DEPLOY_RS_BOOT: Whether this is a boot (--boot) deploy.1if boot mode,0otherwise.Tool use disclosure:
This feature was implemented using Claude Code. I understand the changes being made and present them as my own work.