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
This commit is contained in:
parent
2574113870
commit
3b182c7821
34
playbooks/sync-to-review-test.yaml
Normal file
34
playbooks/sync-to-review-test.yaml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
- 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
|
Loading…
Reference in New Issue
Block a user