Skip to content

Run a component's release command before the deploy switches current (S-005-1..7, 10, 11) #119

Closed

Description

@shipmill-romamo

Builds part of spec S-005, docs/specs/005-release-command.md (feature issue #88): the acceptance criteria below. Each needs a test that names its id (test_s005_<k>_..., or a proves: S-005-1 comment line).

This is the schema, the validation, and the release command in the deploy role.

  • S-005-1: A component with release.command that creates a table deploys with cloudfall deploy --yes, the table exists afterwards, and the release receipt has releaseCommand with the command, exitCode: 0 and an outputTail
  • S-005-2: The command runs after the Materialize locked dependencies for the release task and before the Install the managed service unit and Switch the current release symlink tasks, as the application's linuxUser, with the new release directory (or its workingDirectory) as its working directory
  • S-005-3: A release command that prints every variable sees each key of the installed <installRoot>/shared/env/<component>.env, values with the same quoting rules the unit applies
  • S-005-4: A release command that exits 1 makes deploy --yes exit ENGINE_STEP_FAILED with an error.message naming the release command and exit code 1; current still points at the previous release on every server, the unit file is unchanged, the service was not restarted, and no release receipt was written
  • S-005-5: A release command still running after timeoutSeconds is stopped and fails the deploy the same way, with an error.message naming the timeout
  • S-005-6: With deployment.servers: [b, a], the command runs once, on b, before either server's current moves, and every release receipt from that deploy names b in releaseCommand.server
  • S-005-7: releaseCommand.outputTail holds at most the last 2000 characters of a command that prints more
  • S-005-10: A component without release deploys with the same Ansible tasks as before and a receipt with no releaseCommand
  • S-005-11: config validate exits CONFIG_INVALID for a release.workingDirectory that is absolute or contains .., an empty release.command, or a timeoutSeconds outside 1 to 1800

Activity

  1. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    Triage: implement, for the next release candidate.

    The plan: build the criteria listed in the body, as docs/specs/005-release-command.md (S-005, approved in #102) says, each with a test that names its id. A departure from a criterion goes back as a question, never a quiet change. Build issues start in order: this one starts once every issue on its Depends on lines has closed. I'll link the PR here.

  2. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    The build is in #135: a component's release.command runs once, through systemd-run as the application's user with the unit's env file, on the first server of deployment.servers, before any server's current moves; a failure or timeout stops the deploy with nothing switched. For a component with release, that server now deploys first. Proven with local and rendered tests; no live Debian run yet. This issue closes when #135 merges.

  3. added 2 commits that reference this issue on Oct 27, 2026
    ef6623d
    675d9bd
  4. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    Released in v0.8.0rc6 (pre-release). uv tool install --prerelease allow cloudfall==0.8.0rc6
    A plain install gets it with the next stable release.
    If you filed this: react 👍 on this comment once it works for you, or reply if it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions