How littledrongo/deployctl works
deployctl is a Go command-line tool that builds applications locally, deploys them to configured servers over SSH/SCP, and manages Docker containers. The main workflow is CLI → project/config resolution → cross-platform build → artifact transfer and transactional remote launch, followed by readiness checks and rollback on failure. Separate branches initialize projects, inspect server prerequisites, observe/manage containers, create releases, clean artifacts, and provide Bash completion. Several implementation files are unsampled; edges there are limited to documented behavior and indexed references.
Main entry points: cli.go Command dispatch · remote.go Remote commands · ssh.go SSH and SCP · deploy.go Deployment transaction
Components 22
Command interface
- Command dispatch
internal/cli/cli.go - Remote commands
internal/cli/remote.go - Bash completion
internal/completion/completion.go
Project preparation
- Project initialization
internal/setup/setup.go - Configuration
internal/config/config.go - Module discovery
internal/project/project.go
Build and metadata
- Cross-platform build
internal/build/build.go - Artifact handling
internal/build/artifact.go - Git metadata
internal/gitmeta/git.go - Git release
internal/release/release.go - Artifact cleanup
internal/clean/clean.go
Remote operations
- Deployment transaction
internal/deploy/deploy.go - Remote Docker scripts
internal/deploy/scripts.go - SSH and SCP
internal/deploy/ssh.go - Server checks
internal/deploy/doctor.go - Status and logs
internal/deploy/observe.go - Container controls
internal/deploy/manage.go - Image versioning
internal/deploy/images.go - Diagnostic redaction
internal/deploy/redact.go - Remote output
internal/terminal/remote.go
Other components
- Developer
- Deployment server
Connections 31
- Developer → Command dispatch: runs commands
README.md - Command dispatch → Remote commands: dispatches remote
internal/cli/cli.go - Command dispatch → Project initialization: initializes project
internal/cli/cli.go - Command dispatch → Cross-platform build: runs build
internal/cli/cli.go - Command dispatch → Git release: creates release
internal/cli/cli.go - Command dispatch → Artifact cleanup: cleans artifacts
internal/cli/cli.go - Command dispatch → Bash completion: dispatches completion
internal/cli/cli.go - Command dispatch → Configuration: checks config
internal/cli/cli.go - Command dispatch → Git metadata: reads Git metadata
internal/cli/cli.go - Project initialization → Configuration: generates config
internal/setup/setup.go - Remote commands → Module discovery: finds module
internal/cli/remote.go - Remote commands → Configuration: loads targets
internal/cli/remote.go - Remote commands → Cross-platform build: builds target
internal/cli/remote.go - Remote commands → Deployment transaction: starts deployment
internal/cli/remote.go - Remote commands → Server checks: checks target
internal/cli/remote.go - Remote commands → Status and logs: queries status/logs
internal/cli/remote.go - Remote commands → Container controls: manages container
internal/cli/remote.go - Cross-platform build → Artifact handling: writes artifact
- Cross-platform build → Git metadata: uses repository metadata
- Remote commands → Image versioning: versions image
- Deployment transaction → SSH and SCP: uploads and executes
internal/deploy/deploy.go - Deployment transaction → Remote Docker scripts: runs transaction script
- Deployment transaction → Deployment server: deploys remotely
README.md - Server checks → SSH and SCP: runs remote checks
internal/deploy/doctor.go - Status and logs → SSH and SCP: requests remote state
internal/deploy/observe.go - Container controls → SSH and SCP: runs container action
- SSH and SCP → Diagnostic redaction: redacts diagnostics
internal/deploy/ssh.go - SSH and SCP → Remote output: formats remote output
internal/deploy/ssh.go - Artifact cleanup → Artifact handling: removes artifact directory
- Bash completion → Configuration: loads target names
internal/completion/completion.go - Bash completion → Module discovery: finds module
internal/completion/completion.go