Skip to content

app logs/stop/restart/status: target active slot, not legacy /opt/conoha/<app> #93

@crowdy

Description

@crowdy

Background

The conoha-proxy blue/green refactor changed the on-disk layout from:

```
/opt/conoha// # single slot, overwritten on each deploy
```

to:

```
/opt/conoha//CURRENT_SLOT # text file naming the active slot
/opt/conoha/// # slot-specific work dirs (blue/green)
/opt/conoha///
```

Deploy scopes `docker compose` via `-p -` and accessories via `-p -accessories`.

These commands were left untouched during the core refactor and still assume the old single-slot layout:

  • `cmd/app/logs.go` — `workDir := "/opt/conoha/" + ctx.AppName`
  • `cmd/app/stop.go` — (runs `docker compose down` in that workDir)
  • `cmd/app/restart.go` — same
  • `cmd/app/status.go` — `workDir := "/opt/conoha/" + ctx.AppName`

What to do

Rewrite each command to discover the current slot and operate on its compose project:

  1. SSH-read `/opt/conoha//CURRENT_SLOT` into a slot ID.
  2. Run `docker compose -p - ...` (or `docker logs`/`docker ps --filter label=...`) instead of `cd `.
  3. For `status` in particular, merge in the proxy-side phase/active-target info (design spec §3.2 already calls for this).
  4. For `logs`: follow the active web container by name — `--`.
  5. Handle the 'no CURRENT_SLOT yet' case (= 'never deployed') with a clean error.

Acceptance

  • Each command works against a server that has been deployed via the new blue/green flow.
  • Each command fails with a helpful message when no deploy has happened yet.
  • Tests mock the SSH layer and verify shell-command synthesis.

Prerequisites

Merge feat/proxy-deploy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions