infrastructure/.drone.yml
Tobias Manske 0bdaa53bcd
All checks were successful
continuous-integration/drone/push Build is passing
Drone CI: Only run on reachable hosts
2023-03-13 22:46:12 +01:00

47 lines
1.0 KiB
YAML

---
kind: pipeline
type: docker
name: Ansible-Playbook
trigger:
branch:
- main
event:
include:
- push
- custom
node:
ansible: true
steps:
- name: Run Ansible
image: registry.tobiasmanske.de/ansible-runner:latest
pull: always
commands:
- cd coreos-config
- ansible-playbook --limit host.nc.chaoswg.org --private-key /ssh_key --inventory=inventory.yaml playbook.yaml
- name: Validate Ansible
image: registry.tobiasmanske.de/ansible-runner:latest
pull: always
commands:
- cd coreos-config
- ansible-playbook --limit host.nc.chaoswg.org --check --private-key /ssh_key --inventory=inventory.yaml playbook.yaml
- name: Notify Discord
when:
status:
- failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
message: >
{{repo.name}}
Deployment {{build.number}} failed!
{{build.link}}
image_pull_secrets:
- registry