Remove command to get a database from the server

This commit is contained in:
Oliver Davies 2020-11-02 01:20:24 +00:00
parent 147a5ad1da
commit 26c1138139
2 changed files with 0 additions and 41 deletions

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
main() {
cd tools/ansible
ansible-playbook download-database.yml
ddev import-db --src ../../dump.sql.gz
rm ../../dump.sql.gz
}
main

View file

@ -1,31 +0,0 @@
---
- name: Download a database
hosts: all
vars_files:
- vars/vars.yml
vars:
export_filename: /tmp/dump.sql
tasks:
- name: Export the database
command:
cmd: >
../vendor/bin/drush sql-dump
--gzip
--result-file={{ export_filename }}
chdir: "{{ project_root_path }}/{{ ansistrano_current_dir }}/{{ project_web_dir }}"
creates: "{{ export_filename }}"
- name: Fetch the database from the server
fetch:
src: "{{ export_filename }}.gz"
dest: "{{ playbook_dir }}/../../"
flat: true
- name: Remove the export from the server
file:
path: "{{ export_filename }}.gz"
state: absent