From 08ded46400aedb0e5f3a939fafccacdcd440813b Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Fri, 5 Aug 2022 09:02:17 -0400 Subject: [PATCH] Add in a check for jenkins build url envar This will give CI users additional context where AT-based workflows are originating. --- broker/providers/ansible_tower.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/broker/providers/ansible_tower.py b/broker/providers/ansible_tower.py index 11fb798a..cd9c3e22 100644 --- a/broker/providers/ansible_tower.py +++ b/broker/providers/ansible_tower.py @@ -1,6 +1,7 @@ import click import inspect import json +import os import yaml from urllib import parse as url_parser from functools import cached_property @@ -417,6 +418,8 @@ def execute(self, **kwargs): subject = "workflow" get_path = self.v2.workflow_job_templates kwargs["_broker_origin"] = find_origin() + if (jenkins_url := os.environ.get("BUILD_URL")): + kwargs["_jenkins_url"] = jenkins_url elif name := kwargs.get("job_template"): subject = "job_template" get_path = self.v2.job_templates