Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
syncontent
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Web Essentials Jira
Web Essentials Jira
Labels
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Visay Keo
syncontent
Commits
3e15d5d2
Commit
3e15d5d2
authored
Jan 15, 2016
by
Visay Keo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Allow setting to search replace db content
parent
4ecc1221
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
4 deletions
+30
-4
CHANGELOG
CHANGELOG
+3
-2
README.md
README.md
+21
-0
ansible/roles/database/defaults/.gitignore
ansible/roles/database/defaults/.gitignore
+1
-0
ansible/roles/database/defaults/main.yml
ansible/roles/database/defaults/main.yml
+0
-2
ansible/roles/database/tasks/typo3.yml
ansible/roles/database/tasks/typo3.yml
+5
-0
No files found.
CHANGELOG
View file @
3e15d5d2
CHANGELOG
=========
3.0
-dev
-----
--
3.0
.7
-----
- [FEATURE] Allow setting to search replace db content
- [IMP] Set data directory list to sync in variable
3.0.6
...
...
README.md
View file @
3e15d5d2
...
...
@@ -161,6 +161,27 @@ To execute this task only, run this command:
bin-dir/syncontent
--ansible-tags
=
db
```
For TYPO3, most of the time after restoring data, the domain records need to be adjusted to match your local setup.
In this case, you can provide a list of pair value so that this tool can search and replace it before restoring to your
local system.
To do that, create a file called
`main.yml`
in
`ansible/roles/database/defaults/`
directory and add the following content:
```
---
# Content replacement in database
replacement:
1:
search: live-domain.com
replace: local-site:8080
2:
search: live-domain2.net
replace: domain2.local-site:8080
```
`replacement`, `search` and `replace` are keyword but for `1` and `2` you can use any strings to define your content type.
Just add more array list with `search` and `replace` pair if needed.
### 3. cleanup
The last step is to run some necessary commands needed by the framework for the application to work.
...
...
ansible/roles/database/defaults/.gitignore
0 → 100644
View file @
3e15d5d2
/*
ansible/roles/database/defaults/main.yml
deleted
100644 → 0
View file @
4ecc1221
---
# defaults file for database
ansible/roles/database/tasks/typo3.yml
View file @
3e15d5d2
...
...
@@ -5,6 +5,11 @@
synchronize
:
mode=pull src="{{ remote_dump }}" dest="/tmp/{{ ssh_user }}/db_dump.sql"
when
:
not from_cache|bool
-
name
:
Search and replace content in database dump
local_action
:
replace dest="/tmp/{{ ssh_user }}/db_dump.sql" regexp="{{ item.value.search }}" replace="{{ item.value.replace }}"
with_dict
:
replacement | default({})
when
:
not from_cache|bool
-
name
:
Drop local database
local_action
:
shell {{ bin_path }}/dockertypo3 run db mysqladmin -h db -u root -proot drop dockertypo3 -f
chdir="{{ local_path }}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment