1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-12-23 07:14:22 +00:00
config-fish/functions/redocker.fish

25 lines
656 B
Fish
Raw Normal View History

2024-08-21 09:45:18 +00:00
which docker --skip-functions >/dev/null 2>/dev/null
2024-08-21 19:59:02 +00:00
if [ $status -eq 0 ]
2024-08-21 09:45:18 +00:00
function redocker
set project (docker compose config --format json | jq --raw-output .name)
2024-08-21 19:59:02 +00:00
log-i "Re-instantiating" "$project" "..."
2023-11-13 03:44:50 +00:00
2024-08-21 19:59:02 +00:00
log-t "Pulling images used by " "$project" "..."
2024-08-21 09:45:18 +00:00
command docker compose pull
2023-11-13 03:44:50 +00:00
2024-08-21 19:59:02 +00:00
log-t "Building images using by " "$project" "..."
2024-08-21 09:45:18 +00:00
command docker compose build
2023-11-13 03:44:50 +00:00
2024-08-21 19:59:02 +00:00
log-t "Taking down " "$project" "..."
2024-08-21 09:45:18 +00:00
command docker compose down
2023-11-13 03:44:50 +00:00
2024-08-21 19:59:02 +00:00
log-t "Bringing up " "$project" "..."
2024-08-21 09:45:18 +00:00
command docker compose up -d
2024-08-21 19:59:02 +00:00
log-s "Re-instantiated" "$project" "!"
2024-08-21 09:45:18 +00:00
2024-08-21 19:59:02 +00:00
log-t "Opening logs of " "$project" "..."
2024-08-21 09:45:18 +00:00
command docker compose logs -f
end
2023-11-13 03:44:50 +00:00
end