@@ -16,10 +16,9 @@ def parseInputArguments():
16
16
def main ():
17
17
try :
18
18
args = parseInputArguments ()
19
- os .path .dirname (os .path .abspath (__file__ ))
20
-
21
- os .chdir (os .path .dirname (os .path .abspath (__file__ )))
22
-
19
+
20
+ os .chdir (os .path .normpath (os .path .join (os .path .dirname (os .path .abspath (__file__ )), "compose/ci/stages/dev" )))
21
+
23
22
key = args .ssh
24
23
platform = args .platform
25
24
arch = args .arch
@@ -35,24 +34,18 @@ def main():
35
34
36
35
if subprocess .call (["docker" , "volume" , "inspect" , "ssh" ], stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL ) != 0 :
37
36
subprocess .run (["docker" , "volume" , "create" , "ssh" ], check = True ) # create ssh volume if not present
38
-
39
- # TODO: Unix/Macos when needed
40
- #subprocess.call(f"docker rm -f dev.ssh.intermediate", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
41
- #subprocess.run(f"docker run -d -v ssh:C:\\volume-mount-point --name dev.ssh.intermediate artifactory.devsh.eu/nabla/windows/base:latest", check=True) # create intermediate container
42
- #subprocess.run(f"docker start dev.ssh.intermediate", check=True) # start intermediate container
43
- #subprocess.run(f"docker cp {key} dev.ssh.intermediate:C:\\volume-mount-point", check=True) # copy ssh key to ssh volume
44
- #subprocess.call(f"docker rm -f dev.ssh.intermediate", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
45
-
46
- os .chdir ("./compose/ci/stages/dev" )
47
-
37
+
48
38
compose = [
49
39
"docker" , "compose" ,
50
40
"-f" , f"./compose.{ platform } .{ arch } .yml" ,
51
41
"--env-file" , "../.env/platform/windows/.env"
52
42
]
53
43
54
- subprocess .run (compose + ["up" , "--build" ], check = True ) # compose up pipeline
55
- subprocess .run (compose + ["down" ], check = True ) # compose down pipeline
44
+ subprocess .run (compose + ["build" ], check = True )
45
+ subprocess .run (compose + ["create" , "--force-recreate" ], check = True )
46
+ subprocess .run (compose + ["cp" , key , "nabla.init:key" ], check = True )
47
+ subprocess .run (compose + ["up" ], check = True )
48
+ subprocess .run (compose + ["down" ], check = True )
56
49
57
50
except subprocess .CalledProcessError as e :
58
51
print (f"Subprocess failed with exit code { e .returncode } " )
0 commit comments