2.4 KiB
2.4 KiB
name, description
| name | description |
|---|---|
| mosaic-portainer | Manage Docker Swarm stacks through Portainer when a Portainer credential is available. Use when asked to list, start, stop, redeploy, or check logs through Portainer. |
mosaic-portainer
Manage Portainer stacks through supplied scripts.
Decision Gate
Portainer is optional. Use this skill only when the estate holds a Portainer credential. If a stack README documents docker stack deploy on the manager, that is the deploy path. Do not propose Portainer otherwise.
Setup
After confirming a Portainer credential is available, load it before running scripts:
source ~/.config/mosaic/tools/_lib/credentials.sh
load_credentials portainer
# Exports: PORTAINER_URL, PORTAINER_API_KEY
Scripts
All scripts live in ~/.config/mosaic/tools/portainer/.
| Script | Purpose | Key flags |
|---|---|---|
stack-list.sh |
List all stacks | — |
stack-status.sh |
Status of a stack | -n <name> |
stack-redeploy.sh |
Redeploy (file or git-based) | -n <name> [-p] (pull images) |
stack-start.sh |
Start a stopped stack | -n <name> |
stack-stop.sh |
Stop a running stack | -n <name> |
stack-logs.sh |
Tail stack logs | -n <name> [-l lines] |
endpoint-list.sh |
List Portainer endpoints | — |
Common Workflows
Redeploy a stack through Portainer:
source ~/.config/mosaic/tools/_lib/credentials.sh && load_credentials portainer
~/.config/mosaic/tools/portainer/stack-redeploy.sh -n <stack-name> -p
Check all stack statuses:
source ~/.config/mosaic/tools/_lib/credentials.sh && load_credentials portainer
~/.config/mosaic/tools/portainer/stack-list.sh
Tail logs for a service:
source ~/.config/mosaic/tools/_lib/credentials.sh && load_credentials portainer
~/.config/mosaic/tools/portainer/stack-logs.sh -n <stack-name> -l 100
Notes
stack-redeploy.sh -pdoes not override a digest-pinned image. Follow the stack README's documented deployment procedure for pinned images.- Credentials are loaded through
load_credentials portainer.