1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// taskComposeDestroy tears down the docker stack including volumes
// this is using goyek task framework for Make alternative
func taskComposeDestroy() goyek.Task {
return goyek.Task{
Name: "compose-destroy",
Usage: "remove stack with prejudice",
Action: func(tf *goyek.TF) {
dcBase := filepath.Join(BuildRoot, "docker", "docker-compose.myservice.yml")
dcMySQL := filepath.Join(BuildRoot, "docker", "docker-compose.mysql.yml")
compose := tf.Cmd("docker", "compose", "-f", dcBase, "-f", dcMySQL, "down", "--volumes", "--remove-orphans")
if err := compose.Run(); err != nil {
tf.Fatalf("❗ docker-compose down failed: [%v]", err)
}
tf.Log("✅ docker-compose ran successfully")
},
}
}
|
Webmentions
(No webmentions yet.)