Skip to content
Snippets Groups Projects
Commit e6242c9b authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Add publisher script

parent f5bc69f5
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
from glob import glob
import subprocess as sp
import sys
import time
REGISTRY_URL = 'docker.km3net.de'
def main():
dockerfiles = glob('base/*:*')
n_files = len(dockerfiles)
print("Processing {} dockerfiles...".format(n_files))
for idx, fname in enumerate(dockerfiles):
progress = "({}/{})".format(idx + 1, n_files)
print('-' * 79)
print("{} Building '{}'".format(progress, fname))
build_cmd = ("docker build --pull -t {0}/{1} -f {1} . ".format(
REGISTRY_URL, fname))
child = sp.Popen(
build_cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
child.communicate()
print("{} Publishing '{}'".format(progress, fname))
push_cmd = ("docker push {0}/{1}".format(REGISTRY_URL, fname))
child = sp.Popen(
push_cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
child.communicate()
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment