mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
feat(podman-compose): add podman-compose plugin with aliases and docs
This commit is contained in:
parent
061f773dd3
commit
4525be3d7b
2 changed files with 74 additions and 0 deletions
36
plugins/podman-compose/README.md
Normal file
36
plugins/podman-compose/README.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Podman-compose plugin
|
||||
|
||||
This plugin provides aliases for [podman-compose](https://github.com/containers/podman-compose), a tool for running podman containers using compose files.
|
||||
It is inspired by the `docker-compose` plugin and includes similar aliases for a familiar workflow.
|
||||
|
||||
To use it, add `podman-compose` to the plugins array of your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... podman-compose)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|------------|----------------------------------|----------------------------------------------------------------------------------|
|
||||
| pco | `podman-compose` | Podman-compose main command |
|
||||
| pcb | `podman-compose build` | Build containers |
|
||||
| pce | `podman-compose exec` | Execute command inside a container |
|
||||
| pcps | `podman-compose ps` | List containers |
|
||||
| pcrestart | `podman-compose restart` | Restart container |
|
||||
| pcrm | `podman-compose rm` | Remove container |
|
||||
| pcr | `podman-compose run` | Run a command in container |
|
||||
| pcstop | `podman-compose stop` | Stop a container |
|
||||
| pcup | `podman-compose up` | Build, (re)create, start, and attach to containers for a service |
|
||||
| pcupb | `podman-compose up --build` | Same as `pcup`, but build images before starting containers |
|
||||
| pcupd | `podman-compose up -d` | Same as `pcup`, but starts as daemon |
|
||||
| pcupdb | `podman-compose up -d --build` | Same as `pcup`, but build images before starting containers and starts as daemon |
|
||||
| pcdn | `podman-compose down` | Stop and remove containers |
|
||||
| pcl | `podman-compose logs` | Show logs of container |
|
||||
| pclf | `podman-compose logs -f` | Show logs and follow output |
|
||||
| pclF | `podman-compose logs -f --tail 0`| Just follow recent logs |
|
||||
| pcpull | `podman-compose pull` | Pull image of a service |
|
||||
| pcstart | `podman-compose start` | Start a container |
|
||||
| pck | `podman-compose kill` | Kills containers |
|
||||
| pcpause | `podman-compose pause` | Pause containers |
|
||||
| pcunpause | `podman-compose unpause` | Unpause containers |
|
||||
38
plugins/podman-compose/podman-compose.plugin.zsh
Normal file
38
plugins/podman-compose/podman-compose.plugin.zsh
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Aliases for podman-compose
|
||||
# Inspired by the docker-compose plugin
|
||||
|
||||
# Check if podman-compose is installed
|
||||
if (( ! $+commands[podman-compose] )); then
|
||||
# Fallback to 'podman compose' if available
|
||||
if podman compose version >/dev/null 2>&1; then
|
||||
pccmd='podman compose'
|
||||
else
|
||||
return
|
||||
fi
|
||||
else
|
||||
pccmd='podman-compose'
|
||||
fi
|
||||
|
||||
alias pco="$pccmd"
|
||||
alias pcb="$pccmd build"
|
||||
alias pce="$pccmd exec"
|
||||
alias pcps="$pccmd ps"
|
||||
alias pcrestart="$pccmd restart"
|
||||
alias pcrm="$pccmd rm"
|
||||
alias pcr="$pccmd run"
|
||||
alias pcstop="$pccmd stop"
|
||||
alias pcup="$pccmd up"
|
||||
alias pcupb="$pccmd up --build"
|
||||
alias pcupd="$pccmd up -d"
|
||||
alias pcupdb="$pccmd up -d --build"
|
||||
alias pcdn="$pccmd down"
|
||||
alias pcl="$pccmd logs"
|
||||
alias pclf="$pccmd logs -f"
|
||||
alias pclF="$pccmd logs -f --tail 0"
|
||||
alias pcpull="$pccmd pull"
|
||||
alias pcstart="$pccmd start"
|
||||
alias pck="$pccmd kill"
|
||||
alias pcpause="$pccmd pause"
|
||||
alias pcunpause="$pccmd unpause"
|
||||
|
||||
unset pccmd
|
||||
Loading…
Add table
Add a link
Reference in a new issue