Complete lab2 grade 4 implementation and report
This commit is contained in:
+4
-4
@@ -3,7 +3,7 @@ set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
snapshot() {
|
||||
for service in api postgres; do
|
||||
for service in api postgres redis; do
|
||||
id=$(docker compose ps -q "$service")
|
||||
test -n "$id"
|
||||
docker inspect --format '{{.Name}} {{.Id}} {{.State.StartedAt}} {{.State.Status}} {{range .Mounts}}{{if eq .Type "volume"}}{{.Name}} {{end}}{{end}}' "$id"
|
||||
@@ -11,8 +11,8 @@ snapshot() {
|
||||
}
|
||||
|
||||
snapshot > evidence/restart-containers-before.txt
|
||||
docker compose stop api postgres
|
||||
docker compose up -d --wait postgres
|
||||
docker compose stop api postgres redis
|
||||
docker compose up -d --wait postgres redis
|
||||
docker compose up -d --wait api
|
||||
snapshot > evidence/restart-containers-after.txt
|
||||
printf '%s\n' 'API and PostgreSQL restarted without removing volumes.'
|
||||
printf '%s\n' 'API, PostgreSQL and Redis restarted without removing volumes.'
|
||||
|
||||
Reference in New Issue
Block a user