deploy/README.md
author ymh <ymh.work@gmail.com>
Fri, 14 Jun 2019 14:36:17 +0200
changeset 14 30f2ac9a7656
parent 12 d9d75b93e132
child 23 5249c3c623a6
permissions -rw-r--r--
Add command to deploy batabase
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
# Recherchecontributive deployment
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
The deployment is done with ansible.
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
A pipfile is available to set it up.
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
This deployment take 
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
## Start the deploy
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
- `deploy.sh <profile> <hg tag>`. Example: `deploy.sh test tip`
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
## configuration file:
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
- `hosts/hosts.<profile>`
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
- `group_vars/<profile>.yml`
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
- `host_vars/<hostname>/base.yml` base `host_vars/base.yml.tmpl`
14
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    16
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    17
## Database deploy
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    18
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    19
- `deploy_db.sh [CONFIG] [DB_FILE_PATH] [ORIGIN_URL]`
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    20
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    21
With:
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    22
- `CONFIG`: test or prod
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    23
- `DB_FILE_PATH`: The database definition file (SQL)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    24
- `ORIGIN_URL`: The site base URL matching the database file
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    25
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    26
This script call the `deploy_db.yml` ansible script and perform the following operations
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    27
- copy the sql file to the server
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    28
- apply the sql file with wp-cli `db` command
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    29
- search and replace the origin url (wp-cli search-replace)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    30
- set `template_root` option (wp-cli option)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    31
- delete _site_transient_update_themes and _site_transient_theme_roots options (wp-cli option)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    32
- update admin password (wp-cli user update)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    33
- flush cache (wp-cli cache flush)