deploy/README.md
author Riwad Salim <riwad.salim@yahoo.fr>
Wed, 11 Sep 2019 12:30:41 +0200
changeset 37 d6e8b9ad5a74
parent 28 1150866741ec
permissions -rw-r--r--
Add tooltip feature with jquery-ui
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.
28
1150866741ec Update README files
salimr <riwad.salim@yahoo.fr>
parents: 23
diff changeset
     5
This deployment take
1150866741ec Update README files
salimr <riwad.salim@yahoo.fr>
parents: 23
diff changeset
     6
1150866741ec Update README files
salimr <riwad.salim@yahoo.fr>
parents: 23
diff changeset
     7
## Set the deploy environement
1150866741ec Update README files
salimr <riwad.salim@yahoo.fr>
parents: 23
diff changeset
     8
1150866741ec Update README files
salimr <riwad.salim@yahoo.fr>
parents: 23
diff changeset
     9
- `pipenv install`
1150866741ec Update README files
salimr <riwad.salim@yahoo.fr>
parents: 23
diff changeset
    10
- `pipenv shell`
12
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
## Start the deploy
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
- `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
    15
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
## configuration file:
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
- `hosts/hosts.<profile>`
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
- `group_vars/<profile>.yml`
d9d75b93e132 Add deploy files. Prepare first version
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
- `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
    21
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    22
## Database deploy
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    23
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    24
- `deploy_db.sh [CONFIG] [DB_FILE_PATH] [ORIGIN_URL]`
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
With:
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    27
- `CONFIG`: test or prod
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    28
- `DB_FILE_PATH`: The database definition file (SQL)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    29
- `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
    30
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    31
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
    32
- copy the sql file to the server
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    33
- apply the sql file with wp-cli `db` command
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    34
- 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
    35
- set `template_root` option (wp-cli option)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    36
- 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
    37
- update admin password (wp-cli user update)
30f2ac9a7656 Add command to deploy batabase
ymh <ymh.work@gmail.com>
parents: 12
diff changeset
    38
- flush cache (wp-cli cache flush)
23
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    39
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    40
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    41
## Database dump
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    42
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    43
- `dump_db.sh [CONFIG] [DB_FILE_PATH]`
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    44
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    45
With:
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    46
- `CONFIG`: test or prod
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    47
- `DB_FILE_PATH`: The database definition file (SQL)
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    48
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    49
This script call the `dump_db.sql` ansible script and perform the following operation
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    50
- create a temporary file on the remote host
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    51
- dump the content of the database into this file (wp-cli db export)
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    52
- fetch the file and write it to the givent path
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    53
- delete the temporary file
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    54
5249c3c623a6 Add a command to dump the database
ymh <ymh.work@gmail.com>
parents: 14
diff changeset
    55
**WARNING** : This command write to the destination file and replace it without warning