Skip to content

Switch script/prod to the fail-closed DEPLOY_TAG default once hosts are past 0.3.0 #35

Open

Description

@wadewilliams

Context

The README and SPEC recommend that a project's compose wrapper default DEPLOY_TAG and fail closed, so a manual script/prod up -d on a host never silently moves services to :latest:

if [ -z "${DEPLOY_TAG:-}" ]; then
  DEPLOY_TAG=$(flow-deploy tag) || {
    echo "script/prod: set DEPLOY_TAG (flow-deploy tag couldn't tell)" >&2
    exit 1
  }
  export DEPLOY_TAG
fi

This repo's own script/prod (used to deploy the docs site) doesn't do this yet. That's deliberate for the release that ships #31.

Why not yet

flow-deploy 0.3.0 renders <compose-command> config through script/prod without DEPLOY_TAG, after checking out the new commit. If the fail-closed wrapper shipped in the same release, any deploy run by a still-0.3.0 binary would call flow-deploy tag (a command 0.3.0 doesn't have) from inside the wrapper, exit 1, and fail. For example: a host whose upgrade step was skipped.

Versions after #31 pass DEPLOY_TAG on every compose call, so the wrapper's lookup never runs from inside flow-deploy.

Proposal

Once every host that deploys this repo runs a flow-deploy newer than 0.3.0, switch script/prod to the fail-closed snippet above.

Size

Trivial: about 7 lines in script/prod. Check first: flow-deploy --version for the deploy user on each host.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions