system-config/playbooks/sync-to-review-test.yaml
Monty Taylor 3b182c7821 Add playbook for syncing state from review to review-test
This should be run by hand from bridge, and should sync the git
repos and mysql repo state from review to review-test.

Change-Id: I046f267b0d39e3da94dcb3fe85fbe1e8b5839208
2020-06-15 13:32:05 -05:00

35 lines
840 B
YAML

- hosts: review-test.opendev.org
tasks:
- name: Stop gerrit
shell:
cmd: docker-compose down
chdir: /etc/gerrit-compose
- hosts: review01.openstack.org
tasks:
- name: Copy the mysqldump
shell:
cmd: scp mysql_backups/gerrit.sql.gz.1 review-test.opendev.org:/home/gerrit2/gerrit.sql.gz
chdir: /home/gerrit2
become: gerrit2
- name: Sync the git repos
shell:
cmd: rsync -avz --delete index cache git review-test.opendev.org:/home/gerrit2/review_site
chdir: /home/gerrit2/review_site
become: gerrit2
- hosts: review-test.opendev.org
tasks:
- name: Apply mysql dump
shell:
cmd: zcat /home/gerrit2/gerrit.sql.gz | mysql
- name: Start gerrit
shell:
cmd: docker-compose up -d
chdir: /etc/gerrit-compose