-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
38 lines (28 loc) · 945 Bytes
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
import threading
threads = []
def build_application(app):
threads.append(app)
print("Building application {}".format(app))
os.system("cd {} && ./gradlew build".format(app))
print("Application {} finished building!".format(app))
threads.remove(app)
def docker_compose_up():
print("Running containers!")
os.popen("docker-compose up --build -d").read()
print("Pipeline finished!")
def build_all_applications():
print("Starting application build!")
build_application("stateless-auth-api")
build_application("stateless-any-api")
print("\n")
def remove_containers():
print("Removing containers.")
os.system("docker-compose down")
if __name__ == "__main__":
print("Pipeline started!")
build_all_applications()
while len(threads) > 0:
pass
remove_containers()
threading.Thread(target=docker_compose_up).start()