Finally slack notifications work!

This commit is contained in:
Robert de Bock 2020-09-01 12:34:31 +02:00
parent 5c306217e9
commit 06fd5a6617
2 changed files with 13 additions and 7 deletions

View File

@ -138,17 +138,18 @@
failed_when: no failed_when: no
- name: generate secure hash - 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 register: travis_secure
when: when:
- travis.notifications.slack is defined - (travis.notifications.slack.secure is defined and travis.notifications.slack.secure | length < 512) or
- travis.notifications.slack | length < 512 travis.notifications.slack.secure is not defined
- name: overwrite travis.notifications.slack - name: overwrite travis.notifications.slack.secure
set_fact: set_fact:
travis: travis:
notifications: notifications:
slack: "{{ travis_secure.stdout | regex_replace('\"', '') }}" slack:
secure: "{{ travis_secure.stdout | regex_replace('\"', '') }}"
when: when:
travis_secure.stdout is defined travis_secure.stdout is defined

View File

@ -2,6 +2,9 @@
{{ ansible_managed | comment }} {{ ansible_managed | comment }}
language: python language: python
os: linux
dist: xenial
python: python:
- "3.8" - "3.8"
@ -11,7 +14,7 @@ services:
env: env:
global: global:
namespace="{{ docker_namespace }}" namespace="{{ docker_namespace }}"
matrix: jobs:
{% for platform in meta.galaxy_info.platforms %} {% for platform in meta.galaxy_info.platforms %}
{% for version in platform.versions %} {% for version in platform.versions %}
{% for tag in distribution_version_mapping[platform.name][version] %} {% for tag in distribution_version_mapping[platform.name][version] %}
@ -36,5 +39,7 @@ script:
notifications: notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/ webhooks: https://galaxy.ansible.com/api/v1/notifications/
slack: "{{ travis.notifications.slack }}" slack:
secure: {{ travis.notifications.slack.secure }}
on_success: change
email: false email: false