Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Last active October 13, 2018 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmsimard/baa9863e20c84538956715f4fa037963 to your computer and use it in GitHub Desktop.
Save dmsimard/baa9863e20c84538956715f4fa037963 to your computer and use it in GitHub Desktop.
Zuul actions
# Pseudocode
- name: Return job status to Github
github_comment:
org: "{{ org }}" # openstack-infra
repo: "{{ repo }}" # zuul
pr: "{{ pr }}" # 1234
# Maybe jobs could supply their own comments or comment templates
comment: "{{ comment_defined_by_the_job | default('default_job_comment.j2') }}"
# +1, -2, etc
vote: "{{ vote | default(0) }}"
when: connection_driver == "github"
- name: Return job status to Gerrit
gerrit_comment:
project: "{{ project }}" # openstack-infra/zuul
change: "{{ change }}" # 12345
# Maybe jobs could supply their own comments or comment templates
comment: "{{ comment_defined_by_the_job | default('default_job_comment.j2') }}"
# +1, -2, etc
vote: "{{ vote | default(0) }}"
when: connection_driver == "gerrit"
# Pseudocode
# Vars from the inventory are available since everything is in the same Ansible context
Patch Set {{ zuul.change.patchset }}: {{ vote }}
Build {{ (vote >= 1) | ternary("Succeeded","Failed") }} ({{ pipeline }} pipeline).
{% for job in zuul.jobs %}
{{ job.name }} {{ job.status }} in {{ job.duration }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment