From 06fd5a6617ff4909ef97cafcdad3b46d057b5e71 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Tue, 1 Sep 2020 12:34:31 +0200 Subject: [PATCH] Finally slack notifications work! --- generate.yml | 11 ++++++----- templates/travis.yml.j2 | 9 +++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/generate.yml b/generate.yml index a7c16b3..97d6202 100755 --- a/generate.yml +++ b/generate.yml @@ -138,17 +138,18 @@ failed_when: no - name: generate secure hash - command: "/usr/bin/travis encrypt --pro {{ secure.slack_token }} --no-interactive" + command: /usr/bin/travis encrypt --pro "{{ secure.slack_token }}" --no-interactive register: travis_secure when: - - travis.notifications.slack is defined - - travis.notifications.slack | length < 512 + - (travis.notifications.slack.secure is defined and travis.notifications.slack.secure | length < 512) or + travis.notifications.slack.secure is not defined - - name: overwrite travis.notifications.slack + - name: overwrite travis.notifications.slack.secure set_fact: travis: notifications: - slack: "{{ travis_secure.stdout | regex_replace('\"', '') }}" + slack: + secure: "{{ travis_secure.stdout | regex_replace('\"', '') }}" when: travis_secure.stdout is defined diff --git a/templates/travis.yml.j2 b/templates/travis.yml.j2 index 98ac650..aa4c7e9 100644 --- a/templates/travis.yml.j2 +++ b/templates/travis.yml.j2 @@ -2,6 +2,9 @@ {{ ansible_managed | comment }} language: python +os: linux +dist: xenial + python: - "3.8" @@ -11,7 +14,7 @@ services: env: global: namespace="{{ docker_namespace }}" - matrix: + jobs: {% for platform in meta.galaxy_info.platforms %} {% for version in platform.versions %} {% for tag in distribution_version_mapping[platform.name][version] %} @@ -36,5 +39,7 @@ script: notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ - slack: "{{ travis.notifications.slack }}" + slack: + secure: {{ travis.notifications.slack.secure }} + on_success: change email: false