Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating-cron-path-fixing-mailto #508

Open
wants to merge 2 commits into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Matomo](/roles/cache_clear/cache_clear-matomo)
- [Drupal 8](/roles/cache_clear/cache_clear-mautic)
- [Opcache](/roles/cache_clear/cache_clear-opcache)
- [Symfony](/roles/cache_clear/cache_clear-symfony)
- [ce-dev](/roles/ce_dev)
- [ce-dev prebuild](/roles/ce_dev/ce_dev_prebuild)
- [CLI Tools](/roles/cli)
Expand Down
14 changes: 14 additions & 0 deletions docs/roles/cache_clear/cache_clear-symfony.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Symfony
Clears the Symfony application cache.
<!--TOC-->
<!--ENDTOC-->

<!--ROLEVARS-->
## Default variables
```yaml
---
cache_clear_symfony_env: prod

```

<!--ENDROLEVARS-->
3 changes: 3 additions & 0 deletions docs/roles/cron/cron_drupal7.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ drupal:
# month:
job: cron
# disabled: true
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
cron_mailto: ""
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
defer: false
# If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0]
defer_target: ""
drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush"

```

<!--ENDROLEVARS-->
Expand Down
2 changes: 2 additions & 0 deletions docs/roles/cron/cron_drupal8.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ drupal:
# month:
job: cron
# disabled: true
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
cron_mailto: ""
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
defer: false
# If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0]
Expand Down
8 changes: 8 additions & 0 deletions docs/roles/deploy_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@ Deploying code with autoscaling clusters relies on [cloud-init](https://cloudini
## Default variables
```yaml
---
# Required for NGINX config in feature branching.
_ce_provision_data_dir: /home/deploy/ce-deploy/data

deploy_code:
# Feature branching config.
feature_branch:
enabled: false
# NGINX domains to build, see ce-provision for docs: https://github.com/codeenigma/ce-provision/blob/2.x/roles/debian/nginx/defaults/main.yml#L133
domains: []
# Specify any additional symlink to create, with src (target) and dest (link).
# src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig')
# dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache')
Expand Down
6 changes: 5 additions & 1 deletion docs/roles/sync/database_sync/database_sync-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ mysql_sync:
credentials_file: "/home/{{ deploy_user }}/.mysql.creds"
# This can be of types:
# - rolling: (database backups). In that case we'll need build parameters.@todo
# - fixed: "fixed" database name
# - fixed: "fixed" database name # currently this var means the same as "dump"
# - dump: Use an existing dump. In that case, the "database" variable is the absolute file path.
# This parameter is ignored if var 'path_on_deploy_server' is defined.
type: fixed
# For "rolling builds", so we can compute the database name.
build_id: mybuildprod
Expand All @@ -37,6 +38,9 @@ mysql_sync:
dumps_directory: "/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/db_backups/mysql/regular"
# If the source is on an ASG, provide the ASG name here. Otherwise, leave empty.
asg: ""
# Uncomment and specify full path if you want to use your own dump file on the deploy server (gzip compressed).
# In this case it's the only variable you need in 'database.source'.
#path_on_deploy_server: "/home/{{ deploy_user }}/compressed_database_dump.gz"
target:
database: "{{ project_name }}_dev"
credentials_file: "/home/{{ deploy_user }}/.mysql.creds"
Expand Down
7 changes: 7 additions & 0 deletions roles/cache_clear/cache_clear-symfony/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ Clears the Symfony application cache.
<!--ENDTOC-->

<!--ROLEVARS-->
## Default variables
```yaml
---
cache_clear_symfony_env: prod

```

<!--ENDROLEVARS-->
3 changes: 3 additions & 0 deletions roles/cron/cron_drupal7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ drupal:
# month:
job: cron
# disabled: true
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
cron_mailto: ""
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
defer: false
# If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0]
defer_target: ""
drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush"

```

<!--ENDROLEVARS-->
Expand Down
2 changes: 1 addition & 1 deletion roles/cron/cron_drupal7/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ drupal:
# month:
job: cron
# disabled: true
mailto: "{{ drupal.cron_mailto | default('') }}"
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
cron_mailto: ""
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
defer: false
Expand Down
4 changes: 2 additions & 2 deletions roles/cron/cron_drupal7/tasks/job.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Define cron job command.
ansible.builtin.set_fact:
_cron_job_command: "cd {{ deploy_path }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}"
_cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} > /dev/null 2>&1"

- name: Define cron job command if deferred (ASG).
ansible.builtin.set_fact:
Expand Down Expand Up @@ -31,5 +31,5 @@
job: "{{ _cron_job_command }}"
state: present
disabled: "{{ entry.disabled | default(omit) }}"
mailto: "{{ entry.mailto if entry.mailto is defined else omit }}"
mailto: "{{ entry.mailto | default(omit) }}"
delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}"
2 changes: 2 additions & 0 deletions roles/cron/cron_drupal8/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ drupal:
# month:
job: cron
# disabled: true
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
cron_mailto: ""
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
defer: false
# If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0]
Expand Down
2 changes: 1 addition & 1 deletion roles/cron/cron_drupal8/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ drupal:
# month:
job: cron
# disabled: true
mailto: "{{ drupal.cron_mailto | default('') }}"
# mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses.
cron_mailto: ""
# If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers.
defer: false
Expand Down
9 changes: 2 additions & 7 deletions roles/cron/cron_drupal8/tasks/job.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
---
- name: Define cron job command.
ansible.builtin.set_fact:
_cron_job_command: "cd {{ deploy_path }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}"
_cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }} > /dev/null 2>&1"
when: deploy_operation == "deploy"

- name: Revert cron job command.
ansible.builtin.set_fact:
_cron_job_command: "cd {{ previous_deploy_path }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}"
when: deploy_operation == "revert"

- name: Define cron job command if deferred (ASG).
ansible.builtin.set_fact:
_cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} -m shell -a \"{{ _cron_job_command }}\""
Expand Down Expand Up @@ -37,5 +32,5 @@
job: "{{ _cron_job_command }}"
state: present
disabled: "{{ entry.disabled | default(omit) }}"
mailto: "{{ entry.mailto if entry.mailto is defined else omit }}"
mailto: "{{ entry.mailto | default(omit) }}"
delegate_to: "{{ 'localhost' if drupal.defer else inventory_hostname }}"
8 changes: 8 additions & 0 deletions roles/deploy_code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@ Deploying code with autoscaling clusters relies on [cloud-init](https://cloudini
## Default variables
```yaml
---
# Required for NGINX config in feature branching.
_ce_provision_data_dir: /home/deploy/ce-deploy/data

deploy_code:
# Feature branching config.
feature_branch:
enabled: false
# NGINX domains to build, see ce-provision for docs: https://github.com/codeenigma/ce-provision/blob/2.x/roles/debian/nginx/defaults/main.yml#L133
domains: []
# Specify any additional symlink to create, with src (target) and dest (link).
# src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig')
# dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache')
Expand Down
6 changes: 5 additions & 1 deletion roles/sync/database_sync/database_sync-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ mysql_sync:
credentials_file: "/home/{{ deploy_user }}/.mysql.creds"
# This can be of types:
# - rolling: (database backups). In that case we'll need build parameters.@todo
# - fixed: "fixed" database name
# - fixed: "fixed" database name # currently this var means the same as "dump"
# - dump: Use an existing dump. In that case, the "database" variable is the absolute file path.
# This parameter is ignored if var 'path_on_deploy_server' is defined.
type: fixed
# For "rolling builds", so we can compute the database name.
build_id: mybuildprod
Expand All @@ -37,6 +38,9 @@ mysql_sync:
dumps_directory: "/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/db_backups/mysql/regular"
# If the source is on an ASG, provide the ASG name here. Otherwise, leave empty.
asg: ""
# Uncomment and specify full path if you want to use your own dump file on the deploy server (gzip compressed).
# In this case it's the only variable you need in 'database.source'.
#path_on_deploy_server: "/home/{{ deploy_user }}/compressed_database_dump.gz"
target:
database: "{{ project_name }}_dev"
credentials_file: "/home/{{ deploy_user }}/.mysql.creds"
Expand Down
Loading