Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
drupal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
drupal
Commits
4b20477a
Commit
4b20477a
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Implement tasks to copy database and assets from one stage to another
parent
3c8a3de9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tasks/copy_data/main.yml
+45
-0
45 additions, 0 deletions
tasks/copy_data/main.yml
tasks/main.yml
+11
-0
11 additions, 0 deletions
tasks/main.yml
with
56 additions
and
0 deletions
tasks/copy_data/main.yml
0 → 100644
+
45
−
0
View file @
4b20477a
---
# file: roles/drupal/tasks/copy_data/main.yml
-
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 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
:
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
:
Set files ownership
file
:
path
:
'
{{
webRoot
}}/files'
owner
:
'
{{
apacheUser
}}'
group
:
'
{{
apacheUser
}}'
mode
:
ug+rw
recurse
:
yes
follow
:
no
tags
:
-
copy_db_and_assets
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
11
−
0
View file @
4b20477a
...
...
@@ -89,3 +89,14 @@
-
collect_asset_archive
when
:
(not excluded_roles or "drupal" not in excluded_roles) and drupal_install_drupal and collect_download is defined and collect_download
-
block
:
-
name
:
Copy data from stage to stage
include_tasks
:
copy_data/main.yml
with_items
:
'
{{
drupal_settings|default([])
}}'
loop_control
:
loop_var
:
drupal
when
:
siteproject is defined and drupal.siteproject is defined and siteproject == drupal.siteproject and destination_branch == drupal.src.git.branch
tags
:
-
copy_db_and_assets
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment