-
-
Notifications
You must be signed in to change notification settings - Fork 607
/
main.yml
70 lines (57 loc) · 2.8 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# If you use the "git" strategy:
# - you must set a repository (no default)
project_git_repo: "{{ project.repo }}"
# - you can set the git ref to deploy (can be a branch, tag or commit hash)
project_version: "{{ project.branch | default('master') }}"
# The source_path is used to fetch the tags from git, or synchronise via rsync. This way
# you do not have to download/sync the entire project on every deploy
project_source_path: "{{ project_root }}/shared/source"
# There are certain folders you'll want to copy from release to release to speed up deploys.
# Examples: Composer's `vendor` folder, npm's `node_modules`.
# These should not be part of project_shared_children since dependencies need to be atomic and tied to a deploy.
project_copy_folders:
- vendor
# All the templates to process on the remote system on deploy. These could contain config files.
# `src` and `dest` paths work the same as project_local_files.
project_templates:
- name: .env config
src: roles/deploy/templates/env.j2
dest: .env
# The shared_children is a list of all files/folders in your project that need to be linked to a path in `/shared`.
# For example a sessions directory or an uploads folder. They are created if they don't exist, with the type
# specified in the `type` key (file or directory).
# Example:
# project_shared_children:
# - path: app/sessions
# src: sessions
# mode: '0755' // <- optional, must be quoted, defaults to `'0755'` if `directory` or `'0644'` if `file`
# type: directory // <- optional, defaults to `directory`, options: `directory` or `file`
project_shared_children:
- path: web/app/uploads
src: uploads
# The project_environment is a list of environment variables that can be used in hooks
# Example:
# project_environment:
# WP_ENV: "production"
project_environment:
WP_ENV: "{{ env }}"
# The project_current_path is the symlink used for the latest or active deployment
# - default is 'current'
project_current_path: "{{ project.current_path | default('current') }}"
# Whether to run `wp core update-db` at end of each deploy
update_db_on_deploy: true
# Helpers
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
project_local_path: "{{ (lookup('env', 'USER') == 'vagrant') | ternary(project_root + '/' + project_current_path, project.local_path) }}"
# Deploy hooks
# For list of hooks and explanation, see https://roots.io/trellis/docs/deploys/#hooks
deploy_build_before:
- "{{ playbook_dir }}/deploy-hooks/build-before.yml"
deploy_build_after:
- "{{ playbook_dir }}/roles/deploy/hooks/build-after.yml"
# - "{{ playbook_dir }}/deploy-hooks/sites/{{ site }}-build-after.yml"
deploy_finalize_before:
- "{{ playbook_dir }}/roles/deploy/hooks/finalize-before.yml"
deploy_finalize_after:
- "{{ playbook_dir }}/roles/deploy/hooks/finalize-after.yml"