Add compose.#Up test in universe

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-17 17:12:51 +02:00
parent 5029b5d815
commit ae209ee090
22 changed files with 693 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
package compose
import (
"dagger.io/docker"
"dagger.io/docker/compose"
)
TestCompose: {
up: compose.#Up & {
ssh: {
host: "143.198.64.230"
user: "root"
}
composeFile: #"""
version: "3"
services:
nginx:
image: nginx:alpine
ports:
- 8000:80
"""#
}
verify: docker.#Command & {
ssh: up.run.ssh
command: #"""
docker container ls | grep "nginx" | grep "Up"
"""#
}
// Can't simply use docker.#Command because we need to keep docker-compose context
cleanup: #CleanupCompose & {
context: up.run
ssh: verify.ssh
}
}