Skip to content

Commit

Permalink
feat: add just ext docker-start cmd (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOdin authored Jan 6, 2025
1 parent 89039b2 commit 96ac4f5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,18 @@ To make changes to pgai:
just ext psql-shell
```

1. Stop and delete the container:
1. Stop and start the container:

```bash
# Stop the container
just ext docker-stop
# Delete the container
# Start the container
just ext docker-start
1. Delete the container:
```bash
# When stopped, delete the container
just ext docker-rm
```

Expand Down
8 changes: 8 additions & 0 deletions projects/extension/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,12 @@ def docker_run() -> None:
subprocess.run(cmd, shell=True, check=True, env=os.environ, text=True)


def docker_start() -> None:
subprocess.run(
"""docker start pgai-ext""", shell=True, check=True, env=os.environ, text=True
)


def docker_stop() -> None:
subprocess.run(
"""docker stop pgai-ext""", shell=True, check=True, env=os.environ, text=True
Expand Down Expand Up @@ -766,6 +772,8 @@ def run() -> None:
docker_build()
elif action == "docker-run":
docker_run()
elif action == "docker-start":
docker_start()
elif action == "docker-stop":
docker_stop()
elif action == "docker-rm":
Expand Down
3 changes: 3 additions & 0 deletions projects/extension/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ docker-build:
docker-run:
@./build.py docker-run

docker-start:
@./build.py docker-start

docker-stop:
@./build.py docker-stop

Expand Down

0 comments on commit 96ac4f5

Please sign in to comment.