run deployment on roles
All checks were successful
Deploy Containers / Prepare (push) Successful in 4s
All checks were successful
Deploy Containers / Prepare (push) Successful in 4s
This commit is contained in:
@@ -5,7 +5,7 @@ import subprocess
|
||||
def git_diff():
|
||||
args = sys.argv
|
||||
res = subprocess.run(f"git diff --name-only {args[1]} {args[2]}", capture_output=True, shell=True, text=True)
|
||||
return [x for x in res.stdout.strip().split("\n") if "tasks/" in x and "roles/" not in x]
|
||||
return [x for x in res.stdout.strip().split("\n") if "tasks/" in x or "roles/" in x]
|
||||
|
||||
def construct_command(tag = None):
|
||||
command = f"ANSIBLE_CONFIG=ansible.cfg /usr/bin/ansible-playbook main.yml --vault-password-file ~/.vault_pass.txt --tags {tag}_deploy"
|
||||
@@ -38,7 +38,6 @@ def main():
|
||||
failed = []
|
||||
deployed = 0
|
||||
for file in diff:
|
||||
if "tasks/" in file:
|
||||
# separating these for now because roles will typically
|
||||
# have a bunch of other things tied to them
|
||||
if "roles/" not in file:
|
||||
@@ -56,7 +55,12 @@ def main():
|
||||
print(f"Cleaned up container {task_name}")
|
||||
|
||||
# deploy the task, regardless of its status
|
||||
if "roles/" not in file:
|
||||
task = deploy(task_name)
|
||||
else:
|
||||
role_name = file.split("/")[1]
|
||||
task = deploy(role_name)
|
||||
|
||||
if not task:
|
||||
failed.append(task_name)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user