initial commit
This commit is contained in:
parent
cbef7baae8
commit
3286fda597
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from datetime import date
|
import datetime
|
||||||
|
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
print("Invalid number of arguments\n")
|
print("Invalid number of arguments\n")
|
||||||
@ -14,7 +14,7 @@ with open(spec_file,"r") as f:
|
|||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
|
||||||
|
|
||||||
print(">>>>>>>>>> docker_update.py@", date.today()," <<<<<<<<<<")
|
print(">>>>>>>>>> docker_update.py @", datetime.datetime.now()," <<<<<<<<<<")
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
s = line.strip()
|
s = line.strip()
|
||||||
@ -24,13 +24,13 @@ for line in lines:
|
|||||||
if os.path.isdir(fullpath) and ("docker-compose.yml" in os.listdir(fullpath)):
|
if os.path.isdir(fullpath) and ("docker-compose.yml" in os.listdir(fullpath)):
|
||||||
fullpath = os.path.join(fullpath, "docker-compose.yml")
|
fullpath = os.path.join(fullpath, "docker-compose.yml")
|
||||||
print("========= Processing " + fullpath + " =========")
|
print("========= Processing " + fullpath + " =========")
|
||||||
print(subprocess.check_output("docker-compose -f " + fullpath + " pull", shell=True))
|
print(subprocess.check_output("docker-compose -f " + fullpath + " pull", shell=True, stderr=subprocess.STDOUT, stdout=subprocess.STDOUT))
|
||||||
print(subprocess.check_output("docker-compose -f " + fullpath + " up -d", shell=True))
|
print(subprocess.check_output("docker-compose -f " + fullpath + " up -d", shell=True, stderr=subprocess.STDOUT, stdout=subprocess.STDOUT))
|
||||||
else:
|
else:
|
||||||
print("========= Skipping " + fullpath + ": invalid dir or docker-compos.yml =========")
|
print("========= Skipping " + fullpath + ": invalid dir or docker-compos.yml =========")
|
||||||
|
|
||||||
|
|
||||||
print("========== CLEANING UP ==========")
|
print("========== CLEANING UP ==========")
|
||||||
print(subprocess.check_output("docker system prune -af", shell=True))
|
print(subprocess.check_output("docker system prune -af", shell=True, stderr=subprocess.STDOUT, stdout=subprocess.STDOUT))
|
||||||
|
|
||||||
print("Docker update complete!\n")
|
print("Docker update complete!\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user