import os
import sys

kube_command = 'apply'
if len(sys.argv) > 1:
    kube_command = sys.argv[1]

paths = []
for p, _, f in os.walk('./'):
    for file in f:
        if 'deployment.yml' == file:
            paths.append(os.path.join(p, ''))

for path in paths:
    os.system(f"kubectl {kube_command} -f {path}")