From e821d88c17f627d10b1048895eaa51f945db39cb Mon Sep 17 00:00:00 2001 From: Keir Badger Date: Mon, 29 Apr 2024 10:50:34 +0000 Subject: [PATCH] =?UTF-8?q?=C2=A3rd=20try?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/notify_updates | 5 +++++ tasks/main.yml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/files/notify_updates b/files/notify_updates index bc5682e..b0e6377 100755 --- a/files/notify_updates +++ b/files/notify_updates @@ -17,6 +17,11 @@ if [ -z "${AMI_BUILD_JOB_NAME}" ]; then exit 1 fi +if [ "${AMI_BUILD_JOB_NAME}" == '%AMI_BUILD_JOB_NAME%' ]; then + echo 'AMI_BUILD_JOB_NAME contains placeholder, ignoring' >&1 + exit 0 +fi + if [ -z "${STATELESS_INSTANCE}" ]; then echo 'STATELESS_INSTANCE should be set to 0 or 1' >&1 fi diff --git a/tasks/main.yml b/tasks/main.yml index 5e5b0d1..0b3de1c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,6 +32,12 @@ minute: '0' job: "/usr/local/bin/notify_updates &>> /var/log/notify_updates.log" +- name: Jenkins job name for API + community.general.cronvar: + name: AMI_BUILD_JOB_NAME + value: "%AMI_BUILD_JOB_NAME%" + cron_file: notify_updates + - name: Datadog API token community.general.cronvar: name: DATADOG_API_TOKEN