File tree 7 files changed +21
-14
lines changed
7 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ env = Environment(composepath + '/.env')
22
22
23
23
cmd = [
24
24
os .path .dirname (sys .argv [0 ]) + '/run' ,
25
- 'ps' , 'application '
25
+ 'ps' , '--services' , '--filter' , 'status=running '
26
26
]
27
27
28
28
p = subprocess .Popen (cmd , stdout = subprocess .PIPE )
@@ -36,14 +36,15 @@ except KeyboardInterrupt:
36
36
p .wait ()
37
37
out , err = p .communicate ()
38
38
out = out .decode ('utf-8' )
39
+ runningContainers = out .splitlines ()
39
40
40
41
dockerrun = ['docker' , 'run' , '--rm' ]
41
42
if sys .stdin .isatty () and sys .stdout .isatty ():
42
43
dockerrun += ['-it' ]
43
44
44
45
cmd = dockerrun
45
46
46
- if re . search ( 'Up' , out ) :
47
+ if 'application' in runningContainers :
47
48
containercmd = [
48
49
os .path .dirname (sys .argv [0 ]) + '/run' ,
49
50
'ps' , '-q' , 'application'
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ env = Environment(composepath + '/.env')
22
22
23
23
cmd = [
24
24
os .path .dirname (sys .argv [0 ]) + '/run' ,
25
- 'ps' , 'application '
25
+ 'ps' , '--services' , '--filter' , 'status=running '
26
26
]
27
27
28
28
p = subprocess .Popen (cmd , stdout = subprocess .PIPE )
@@ -36,14 +36,15 @@ except KeyboardInterrupt:
36
36
p .wait ()
37
37
out , err = p .communicate ()
38
38
out = out .decode ('utf-8' )
39
+ runningContainers = out .splitlines ()
39
40
40
41
dockerrun = ['docker' , 'run' , '--rm' ]
41
42
if sys .stdin .isatty () and sys .stdout .isatty ():
42
43
dockerrun += ['-it' ]
43
44
44
45
cmd = dockerrun
45
46
46
- if re . search ( 'Up' , out ) :
47
+ if 'application' in runningContainers :
47
48
containercmd = [
48
49
os .path .dirname (sys .argv [0 ]) + '/run' ,
49
50
'ps' , '-q' , 'application'
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ env = Environment(composepath + '/.env')
13
13
14
14
cmd = [
15
15
os .path .dirname (sys .argv [0 ]) + '/run' ,
16
- 'ps' , 'mysql '
16
+ 'ps' , '--services' , '--filter' , 'status=running '
17
17
]
18
18
19
19
p = subprocess .Popen (cmd , stdout = subprocess .PIPE )
@@ -27,8 +27,9 @@ except KeyboardInterrupt:
27
27
p .wait ()
28
28
out , err = p .communicate ()
29
29
out = out .decode ('utf-8' )
30
+ runningContainers = out .splitlines ()
30
31
31
- if not re . search ( 'Up' , out ) :
32
+ if not 'mysql' in runningContainers :
32
33
raise Exception ('We need a running mysql server' )
33
34
34
35
cmd = [
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ env = Environment(composepath + '/.env')
13
13
14
14
cmd = [
15
15
os .path .dirname (sys .argv [0 ]) + '/run' ,
16
- 'ps' , 'mysql '
16
+ 'ps' , '--services' , '--filter' , 'status=running '
17
17
]
18
18
19
19
p = subprocess .Popen (cmd , stdout = subprocess .PIPE )
@@ -27,8 +27,9 @@ except KeyboardInterrupt:
27
27
p .wait ()
28
28
out , err = p .communicate ()
29
29
out = out .decode ('utf-8' )
30
+ runningContainers = out .splitlines ()
30
31
31
- if not re . search ( 'Up' , out ) :
32
+ if not 'mysql' in runningContainers :
32
33
raise Exception ('We need a running mysql server' )
33
34
34
35
cmd = [
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ if len(sys.argv) <= 1:
16
16
17
17
cmd = [
18
18
os .path .dirname (sys .argv [0 ]) + '/run' ,
19
- 'ps' , 'mysql '
19
+ 'ps' , '--services' , '--filter' , 'status=running '
20
20
]
21
21
22
22
p = subprocess .Popen (cmd , stdout = subprocess .PIPE )
@@ -30,8 +30,9 @@ except KeyboardInterrupt:
30
30
p .wait ()
31
31
out , err = p .communicate ()
32
32
out = out .decode ('utf-8' )
33
+ runningContainers = out .splitlines ()
33
34
34
- if not re . search ( 'Up' , out ) :
35
+ if not 'mysql' in runningContainers :
35
36
raise Exception ('We need a running mysql server' )
36
37
37
38
cmd = [
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ env = Environment(composepath + '/.env')
13
13
14
14
cmd = [
15
15
os .path .dirname (sys .argv [0 ]) + '/run' ,
16
- 'ps' , 'application '
16
+ 'ps' , '--services' , '--filter' , 'status=running '
17
17
]
18
18
19
19
p = subprocess .Popen (cmd , stdout = subprocess .PIPE )
@@ -27,8 +27,9 @@ except KeyboardInterrupt:
27
27
p .wait ()
28
28
out , err = p .communicate ()
29
29
out = out .decode ('utf-8' )
30
+ runningContainers = out .splitlines ()
30
31
31
- if re . search ( 'Up' , out ) :
32
+ if 'application' in runningContainers :
32
33
dockerrun = [os .path .dirname (sys .argv [0 ]) + '/run' , 'exec' ]
33
34
if not sys .stdin .isatty () or not sys .stdout .isatty ():
34
35
dockerrun += ['-T' ]
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ env = Environment(composepath + '/.env')
13
13
14
14
cmd = [
15
15
os .path .dirname (sys .argv [0 ]) + '/run' ,
16
- 'ps' , 'redis '
16
+ 'ps' , '--services' , '--filter' , 'status=running '
17
17
]
18
18
19
19
p = subprocess .Popen (cmd , stdout = subprocess .PIPE )
@@ -27,8 +27,9 @@ except KeyboardInterrupt:
27
27
p .wait ()
28
28
out , err = p .communicate ()
29
29
out = out .decode ('utf-8' )
30
+ runningContainers = out .splitlines ()
30
31
31
- if not re . search ( 'Up' , out ) :
32
+ if not 'redis' in runningContainers :
32
33
raise Exception ('We need a running redis server' )
33
34
34
35
dockerrun = [os .path .dirname (sys .argv [0 ]) + '/run' , 'exec' ]
You can’t perform that action at this time.
0 commit comments