Replies: 1 comment
-
I am not even sure what did I do so differently but here's a full default:
@just --list
[macos]
start_docker:
#!/usr/bin/env bash
if ! colima status 2>/dev/null; then
echo "Colima is not running, starting it now"
colima start --memory 12 --cpu 16 --disk 200
else
echo "Colima is already running"
fi
[linux]
start_docker:
#!/usr/bin/env bash
if ! systemctl is-active -q docker.service; then
sudo systemctl start docker
else
echo "Docker is already running"
fi
[windows]
start_docker:
error("Windows is not supported.")
[macos]
stop_docker:
#!/usr/bin/env bash
if colima status 2>/dev/null; then
echo "Colima is running, stopping it now"
colima stop
else
echo "Colima is not running"
fi
[linux]
stop_docker:
#!/usr/bin/env bash
if systemctl is-active -q docker.service; then
sudo systemctl stop docker
else
echo "Docker is not running"
fi
[windows]
stop_docker:
error("Windows is not supported.")
up:
docker-compose -f {{justfile_directory()}}/dev/docker/docker-compose.yaml up -d
down:
docker-compose -f {{justfile_directory()}}/dev/docker/docker-compose.yaml down
logs:
docker-compose -f {{justfile_directory()}}/dev/docker/docker-compose.yaml logs --follow
all_up: start_docker up
all_down: down stop_docker |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to have something like
just up
that checks if Docker is started and if not, start it, and then proceed to rundocker-compose
.Here is what I have:
I am on macOS. Running
just docker
yields this:Then it proceeds to start it and it starts. It works fine the second time around, too: it doesn't attempt to start it again, while printing the status message.
My questions:
just
and I stick with the bash script fragment then is there a way to suppress the output of everything except the one ofcolima start
?EDIT: Oops, I just realized I could just do
colima status 2>/dev/null
. Still, I'd like to see if I can achieve the rest of what I asked.Beta Was this translation helpful? Give feedback.
All reactions