From 0772ea36d0a0723d51f7a8fb259f5505864580ad Mon Sep 17 00:00:00 2001 From: Alex Frantz Date: Mon, 11 Aug 2025 03:01:36 -0400 Subject: [PATCH] don't excessively fail action --- .gitea/workflows/deploy-all.yml | 26 ++++++++++++++++++++++++++ scripts/deploy_containers.py | 12 +++--------- 2 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 .gitea/workflows/deploy-all.yml diff --git a/.gitea/workflows/deploy-all.yml b/.gitea/workflows/deploy-all.yml new file mode 100644 index 0000000..1c8e16d --- /dev/null +++ b/.gitea/workflows/deploy-all.yml @@ -0,0 +1,26 @@ +name: Deploy All Containers + +on: + workflow_dispatch: + +jobs: + deploy: + name: Prepare + runs-on: runner + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Deploy + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + eval $(ssh-agent -s) + ssh-add <(echo "${{ secrets.SSH_KEY }}") + echo "HOST *" > ~/.ssh/config + echo "${{ secrets.VAULT_PASS }}" > ~/.vault_pass.txt + chmod 600 ansible.cfg + /usr/bin/ansible-playbook main.yml --vault-password-file ~/.vault_pass.txt diff --git a/scripts/deploy_containers.py b/scripts/deploy_containers.py index ef1a544..74c3832 100644 --- a/scripts/deploy_containers.py +++ b/scripts/deploy_containers.py @@ -29,19 +29,13 @@ def run_deployment(tag = None): success = True for ind, line in enumerate(lines): if "fatal:" in line: + success = False host = re.findall(bracket_regex, line)[0] task_failed = re.findall(bracket_regex, lines[ind - 1])[0] reason_failed = re.findall(quote_regex, line) - print("\n---------------------") - print(" Deployment failed!") - print(f" Task: {task_failed}") - print(f" Host: {host}") - print(f" Reason: {reason_failed}") - print(line) - print("---------------------\n") - - sys.exit(1) + print(f"\n{tag} failed deployment!\n{host}\n{reason_failed}\n{task_failed}\n") + break return success