Currently notifications implementation is hardcoded to only work from Travis.
It would be advantageous to allow notifications from GitHub actions, it would be even better to allow notifications from anywhere given appropriate amount of configuration.
Currently any ansible galaxy roles have to run on Travis, for large projects this mean supporting multiple pipeline tools.
For HTTP signatures github user PUBLIC KEYS could be used curl -O https://github.com/<username>.keys initially verify owners of galaxy content and origin of notifications.
Given that we're moving toward Collections, and one can simply publish using ansible-galaxy collection publish and a Galaxy token, this doesn't seem relevant.
@chouseknecht - I believe this may be for roles鈥攊t seems that the role notification support only works for Travis CI, so users who want to switch role CI use to Actions are unable to do so (or, I guess any other CI system, for that matter).
In that case, you have to manually log into Galaxy and navigate to your content and click 'Import' any time you want it updated in Galaxy.
I see it the same way as @wildone there should be a way to trigger the role import into the Galaxy via an API call or something like that so you don't have to rely on travis ci to automatically publish roles in the Galaxy.
Just cam accross this issue, but it looks like you could just call the ansible-galaxy executable from other CI systems. Should ansible-galaxy --token api-key-here github-user-or-org github-repo just work?
FYI I just use (for roles):
on:
push:
tags:
- 'v*'
jobs:
...
release:
name: Publish to ansible-galaxy
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs: [pre-commit, molecule]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: robertdebock/[email protected]
with:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
It might be good to have an "official" action though
For Drone CI I'm doing it like this now:
kind: pipeline
name: galaxy
platform:
os: linux
arch: amd64
steps:
- name: galaxy
image: toolhippie/ansible:latest
pull: always
environment:
galaxy_token:
from_secret: galaxy_token
commands:
- ansible-galaxy role import --token $GALAXY_TOKEN ${DRONE_REPO_OWNER} ${DRONE_REPO_NAME}
trigger:
ref:
- refs/heads/master
- refs/tags/**
status:
- success
Most helpful comment
@chouseknecht - I believe this may be for roles鈥攊t seems that the role notification support only works for Travis CI, so users who want to switch role CI use to Actions are unable to do so (or, I guess any other CI system, for that matter).
In that case, you have to manually log into Galaxy and navigate to your content and click 'Import' any time you want it updated in Galaxy.