diff --git a/playbooks/sync-to-review-test.yaml b/playbooks/sync-to-review-test.yaml new file mode 100644 index 0000000000..a3fc5b5d4f --- /dev/null +++ b/playbooks/sync-to-review-test.yaml @@ -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