|
1 # pharmakon.fr deployment |
|
2 |
|
3 The deployment is done with ansible. |
|
4 A pipfile is available to set it up. |
|
5 |
|
6 |
|
7 ## Set the deploy environement |
|
8 |
|
9 - `pipenv install` |
|
10 - `pipenv shell` |
|
11 |
|
12 ## Start the deploy |
|
13 |
|
14 - `deploy.sh <profile> <hg tag>`. Example: `deploy.sh test tip` |
|
15 |
|
16 ## configuration file: |
|
17 |
|
18 - `hosts/hosts.<profile>` |
|
19 - `group_vars/<profile>.yml` |
|
20 - `host_vars/<hostname>/base.yml` base `host_vars/base.yml.tmpl` |
|
21 |
|
22 ## Database deploy |
|
23 |
|
24 - `deploy_db.sh [CONFIG] [DB_FILE_PATH] [ORIGIN_URL]` |
|
25 |
|
26 With: |
|
27 - `CONFIG`: test or prod |
|
28 - `DB_FILE_PATH`: The database definition file (SQL) |
|
29 - `ORIGIN_URL`: The site base URL matching the database file |
|
30 |
|
31 This script call the `deploy_db.yml` ansible script and perform the following operations |
|
32 - copy the sql file to the server |
|
33 - apply the sql file with wp-cli `db` command |
|
34 - search and replace the origin url (wp-cli search-replace) |
|
35 - set `template_root` option (wp-cli option) |
|
36 - delete _site_transient_update_themes and _site_transient_theme_roots options (wp-cli option) |
|
37 - update admin password (wp-cli user update) |
|
38 - flush cache (wp-cli cache flush) |
|
39 |
|
40 |
|
41 ## Database dump |
|
42 |
|
43 - `dump_db.sh [CONFIG] [DB_FILE_PATH]` |
|
44 |
|
45 With: |
|
46 - `CONFIG`: test or prod |
|
47 - `DB_FILE_PATH`: The database definition file (SQL) |
|
48 |
|
49 This script call the `dump_db.sql` ansible script and perform the following operation |
|
50 - create a temporary file on the remote host |
|
51 - dump the content of the database into this file (wp-cli db export) |
|
52 - fetch the file and write it to the givent path |
|
53 - delete the temporary file |
|
54 |
|
55 **WARNING** : This command write to the destination file and replace it without warning |