2014-10-03 13:14:38 +00:00
|
|
|
# Push out any new badge stuff.
|
|
|
|
#
|
|
|
|
# Badge artists and badge developers should be pushing stuff to this repo:
|
|
|
|
#
|
2017-11-28 11:55:30 +01:00
|
|
|
# https://pagure.io/fedora-badges.git
|
2014-10-03 13:14:38 +00:00
|
|
|
#
|
|
|
|
# This playbook will take any new content from there and push it out onto our
|
|
|
|
# servers.
|
|
|
|
|
2015-09-25 18:49:17 +00:00
|
|
|
- name: get the badges repo happening from the batcave
|
2020-06-14 14:14:31 -07:00
|
|
|
hosts: batcave01.iad2.fedoraproject.org
|
2014-10-03 13:14:38 +00:00
|
|
|
user: root
|
|
|
|
gather_facts: False
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
2015-01-09 22:59:18 +00:00
|
|
|
- "/srv/private/ansible/vars.yml"
|
2014-10-03 13:14:38 +00:00
|
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
|
|
|
|
|
|
vars:
|
2017-11-28 11:55:30 +01:00
|
|
|
upstream: "https://pagure.io/fedora-badges.git"
|
2016-01-15 16:17:42 +00:00
|
|
|
workingdir: /srv/web/infra/badges/
|
2020-08-04 16:50:45 +02:00
|
|
|
local_repo: /srv/git/badges
|
2014-10-03 13:14:38 +00:00
|
|
|
|
|
|
|
tasks:
|
2018-07-11 11:23:56 +02:00
|
|
|
- name: Make a tmp directory
|
|
|
|
tempfile:
|
|
|
|
state: directory
|
2018-07-25 17:48:11 +00:00
|
|
|
suffix: _badges_tempdir
|
2018-07-11 11:23:56 +02:00
|
|
|
register: tmp
|
|
|
|
|
|
|
|
- set_fact:
|
2018-07-25 18:03:53 +00:00
|
|
|
tempdir: "{{tmp.path}}"
|
2018-07-11 11:23:56 +02:00
|
|
|
|
2014-10-03 13:14:38 +00:00
|
|
|
- name: clone the local bare repo
|
2020-08-04 16:24:03 +02:00
|
|
|
git:
|
|
|
|
dest: "{{tempdir}}"
|
2020-08-04 16:50:45 +02:00
|
|
|
repo: "{{local_repo}}"
|
2020-08-04 16:24:03 +02:00
|
|
|
remote: origin
|
|
|
|
update: yes
|
2014-10-03 13:14:38 +00:00
|
|
|
|
2017-03-23 16:19:30 +00:00
|
|
|
- name: add pagure as a second remote
|
2020-08-04 16:24:03 +02:00
|
|
|
command: git remote add pagure {{upstream}}
|
|
|
|
args:
|
|
|
|
chdir: "{{tempdir}}"
|
2014-10-03 13:14:38 +00:00
|
|
|
|
2017-03-23 16:19:30 +00:00
|
|
|
- name: pull down changes from pagure
|
2020-08-04 16:24:03 +02:00
|
|
|
command: git pull pagure master
|
|
|
|
args:
|
|
|
|
chdir: "{{tempdir}}"
|
2014-10-03 13:14:38 +00:00
|
|
|
|
2017-03-23 16:19:30 +00:00
|
|
|
- name: push pagure changes back to the lockbox bare repo
|
2020-08-04 16:24:03 +02:00
|
|
|
command: git push origin master
|
|
|
|
args:
|
|
|
|
chdir: "{{tempdir}}"
|
2014-10-03 13:14:38 +00:00
|
|
|
|
|
|
|
- name: clean up that temporary {{tempdir}} dir
|
2020-08-04 16:24:03 +02:00
|
|
|
file:
|
|
|
|
dest: "{{tempdir}}"
|
|
|
|
state: absent
|
2014-10-03 13:14:38 +00:00
|
|
|
|
2020-08-04 16:50:45 +02:00
|
|
|
- name: fix the working dir repo to use the right location
|
|
|
|
command: git remote set-url origin {{local_repo}}
|
|
|
|
args:
|
|
|
|
chdir: "{{workingdir}}"
|
|
|
|
|
2016-01-15 16:17:42 +00:00
|
|
|
- name: and pull those commits from the bare repo to the working dir
|
2020-08-04 16:24:03 +02:00
|
|
|
command: git pull origin master
|
|
|
|
args:
|
|
|
|
chdir: "{{workingdir}}"
|
2016-01-15 16:17:42 +00:00
|
|
|
|
2015-01-06 16:30:46 +00:00
|
|
|
handlers:
|
2017-10-17 17:37:03 +00:00
|
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
2015-01-06 16:30:46 +00:00
|
|
|
|
2014-10-03 13:14:38 +00:00
|
|
|
- name: copy new badge art over to the badges web nodes
|
2019-05-21 14:49:37 +00:00
|
|
|
hosts: badges_web:badges_web_stg
|
2014-10-03 13:14:38 +00:00
|
|
|
user: root
|
|
|
|
gather_facts: False
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
2015-01-09 22:59:18 +00:00
|
|
|
- "/srv/private/ansible/vars.yml"
|
2014-10-03 13:14:38 +00:00
|
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
|
|
|
|
|
|
roles:
|
|
|
|
- badges/frontend
|
|
|
|
|
2015-01-06 16:30:46 +00:00
|
|
|
handlers:
|
2017-10-17 17:37:03 +00:00
|
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
2015-01-06 16:30:46 +00:00
|
|
|
|
2014-10-03 13:14:38 +00:00
|
|
|
- name: copy any new badges rules over to the badges backend and restart it
|
2019-05-21 14:49:37 +00:00
|
|
|
hosts: badges_backend:badges_backend_stg
|
2014-10-03 13:14:38 +00:00
|
|
|
user: root
|
|
|
|
gather_facts: False
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
2015-01-09 22:59:18 +00:00
|
|
|
- "/srv/private/ansible/vars.yml"
|
2014-10-03 13:14:38 +00:00
|
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
|
|
|
|
|
|
roles:
|
|
|
|
- badges/backend
|
2015-01-06 16:30:46 +00:00
|
|
|
|
|
|
|
handlers:
|
2017-10-17 17:37:03 +00:00
|
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|