Skip to content
Snippets Groups Projects
Commit 2155cad4 authored by jurgenhaas's avatar jurgenhaas
Browse files

Finalize script drupal-data-copy

parent a57217ae
No related branches found
No related tags found
No related merge requests found
......@@ -3,43 +3,37 @@
- block:
- name: Set facts without jails
set_fact:
webRoot: /var/www{{ drupal.webRoot|default("") }}
cronUser: root
apacheUser: www-data
apacheLogDir: /var/log/apache2
drushSubkey: '{{ drupal.drush_subkey|default("") }}'
when: drupal.jail is not defined
- name: Set facts without jails
set_fact:
webRoot: /var/www{{ drupal.webRoot|default("") }}
apacheUser: www-data
when: drupal.jail is not defined
- name: Set facts with jails
set_fact:
webRoot: '{{ jailroot }}/{{ drupal.jail.name }}/var/www{{ drupal.webRoot|default("") }}'
cronUser: '{{ drupal.jail.name }}'
apacheUser: '{{ drupal.jail.name }}'
apacheLogDir: '{{ jailroot }}/{{ drupal.jail.name }}/var/log/apache2'
drushSubkey: .{{ drupal.jail.name }}
when: drupal.jail is defined
- name: Set facts with jails
set_fact:
webRoot: '{{ jailroot }}/{{ drupal.jail.name }}/var/www{{ drupal.webRoot|default("") }}'
apacheUser: '{{ drupal.jail.name }}'
when: drupal.jail is defined
- name: Execute Drush Commands
shell: drush -y {{ item }}
args:
chdir: '{{ webRoot }}'
with_items:
- sql:sync --create-db @{{ drupal.id }}.{{ branch }} @{{ drupal.id }}.{{ destination_branch }}
- rsync @{{ drupal.id }}.{{ branch }}:%files/ @{{ drupal.id }}.{{ destination_branch }}:%files -- --chown={{ apacheUser }}:{{ apacheUser }} --safe-links --max-size=20M
- cr
- updatedb
- config-import sync
- name: Execute Drush Commands
shell: drush -y {{ item }}
args:
chdir: '{{ webRoot }}'
with_items:
- sql:sync --create-db @{{ drupal.id }}_stages.{{ branch }} @{{ drupal.id }}_stages.{{ destination_branch }}
- rsync @{{ drupal.id }}_stages.{{ branch }}:%files/ @{{ drupal.id }}_stages.{{ destination_branch }}:%files -- --chown={{ apacheUser }}:{{ apacheUser }} --safe-links
- cache-rebuild
- updatedb
- config-import sync
- name: Set files ownership
file:
path: '{{ webRoot }}/files'
owner: '{{ apacheUser }}'
group: '{{ apacheUser }}'
mode: ug+rw
recurse: yes
follow: no
- name: Set files ownership
file:
path: '{{ webRoot }}/files'
owner: '{{ apacheUser }}'
group: '{{ apacheUser }}'
mode: ug+rw
recurse: yes
follow: no
tags:
- copy_db_and_assets
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment