Skip to content

Commit e046b08

Browse files
committed
implemented ctrl+c for docker-compose driver for action: run
1 parent f9f37b1 commit e046b08

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### 0.9.0 (2020-Jan-04)
2+
3+
* Implemented Ctrl+C (SigInt) to work for action: run for both drivers (docker and docker-compose).
4+
The change in the run action for docker-compose driver is that now Dojo first explicitly invokes the pull action
5+
and then it invokes the run action.
6+
17
### 0.8.0 (2020-Jan-01)
28

39
* Docker-composer driver: enable printing logs of non default docker containers either to console or to file.

main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,24 @@ func main() {
8787
shellService.SetEnvironment(envService.GetVariables())
8888

8989
if mergedConfig.Action == "pull" {
90+
// just pull the image(s) and exit
9091
exitstatus := driver.HandlePull(mergedConfig)
9192
os.Exit(exitstatus)
9293
}
9394

95+
if mergedConfig.Action == "run" && mergedConfig.Driver == "docker-compose" {
96+
// We have to first pull the image(s) in order to support ctrl+c while pulling.
97+
// If we didn't do it, then docker-compose run command could result in starting some containers
98+
// while pulling some images. Then, on ctrl+c we would stop the docker-compose process, which
99+
// would stop the pulling and also the current (this) main thread. This means that there is no
100+
// way to perform cleaning and the already started containers would be left running.
101+
// (This is not the case for the driver: docker, but it we could implement in the same way).
102+
exitstatus := driver.HandlePull(mergedConfig)
103+
if exitstatus !=0 {
104+
panic("Exit status from pulling the image was not 0")
105+
}
106+
}
107+
94108
// action is run
95109

96110
// This variable is needed to perform cleanup on any signal.

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package main
2-
const DojoVersion = "0.8.0"
2+
const DojoVersion = "0.9.0"
33

0 commit comments

Comments
 (0)