Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3ccfe51
Defer nightly backups, disable ASG processes during syncs and run syn…
EmlynK Jan 20, 2022
a54c09c
Added deploy.yml examples for Drupal 9 and Localgov. Updated tests (#97)
DionisioFG Mar 10, 2022
223a3b5
Adding a new SimpleSAMLphp meta role. (#100)
gregharvey Mar 31, 2022
32843d5
Allowing users to set cachetool version properly. (#102)
gregharvey Apr 13, 2022
91ea64e
Deploy ami pr 1.x (#106)
gregharvey Apr 14, 2022
371b6b9
Making the MySQL dump command for routine back-ups less aggressive. (…
gregharvey Apr 20, 2022
a9cc7ad
Fix database backups pr 1.x (#109)
gregharvey Apr 20, 2022
4c4c3ad
Fix MySQL backup deferral. (#110)
EmlynK Apr 22, 2022
029848d
Files recurse fix pr 1.x (#112)
EmlynK Apr 26, 2022
b71fa83
Improve multisite support (#115)
EmlynK Apr 29, 2022
c933dc8
Static credentials handling fix pr 1.x (#119)
EmlynK May 23, 2022
b6ea020
Making contents of deploy tar 'ownerless'. (#117)
gregharvey May 31, 2022
1c2b206
Implement file syncing (#124)
EmlynK Jun 7, 2022
1cd0ed0
Create Drupal-specific sync roles (#128)
EmlynK Jun 8, 2022
904033f
Fixing GRANT query for MySQL > 8.0. (#131)
gregharvey Jun 10, 2022
94715d8
Use IF NOT EXISTS when creating database user as that command fails i…
EmlynK Jun 13, 2022
42f12c8
Attempt to fix syncs whenever the 'dump' type is used for source or t…
EmlynK Jun 16, 2022
a9c6abf
Squashfs pr 1.x (#150)
gregharvey Jun 20, 2022
a4de771
Check deploy_code.mount_type is defined when setting facts in init ro…
EmlynK Jun 24, 2022
fe2aaf1
Make config imports during syncs optional (#157)
EmlynK Jun 28, 2022
451227d
Squashfs pr 1.x (#153)
gregharvey Jun 29, 2022
c7aae71
Add cache clears to Drupal deployments, before DB updates and stuff (…
EmlynK Aug 16, 2022
15b8daa
Avoid leaving exponentially growing sqsh files in build locations! (#…
gregharvey Sep 5, 2022
5cab4ae
Exclude sqsh file pr 1.x (#167)
gregharvey Oct 6, 2022
459faba
Removing unnecessary lines in Drupal config generation. (#169)
gregharvey Oct 7, 2022
200f590
Ensuring dump directory exists on backup step. (#172)
gregharvey Oct 10, 2022
2c74432
Allowing Drupal 7 jobs to disable cron. (#174)
gregharvey Oct 14, 2022
0385211
Suppress db revert pr 1.x (#177)
gregharvey Oct 14, 2022
86f138a
Fixing bad assumption that databases will have TCP connections. (#179)
gregharvey Nov 18, 2022
b236540
Handling the 'drush deploy' command more elegantly for Drupal 8+. (#180)
gregharvey Dec 9, 2022
58069b6
Attempt to clear the opcache during Drupal deployments. (#182)
gregharvey Dec 9, 2022
3ea0bfe
Better drush deploy support pr 1.x (#185)
gregharvey Dec 9, 2022
b835344
Cron job schedule params pr 1.x (#190)
tymofiisobchenko Dec 30, 2022
e97e852
Adding option to stop services that might interfere with a squashfs m…
gregharvey Jan 23, 2023
7bbb77f
Drush refactor pr 1.x (#197)
gregharvey Jan 25, 2023
cc31f6a
Better deploy_code role docs. (#213)
gregharvey Jan 27, 2023
f6a3cb3
Cachetool settings and drupal7 tasks fix pr 1.x (#211)
tymofiisobchenko Jan 27, 2023
44fef49
previous_cachetool_remove_before_install_new (#224)
tymofiisobchenko Jan 31, 2023
f1b2b90
Fix cachetool removal pr 1.x (#227)
tymofiisobchenko Jan 31, 2023
de6d80b
Fix cachetool removal pr 1.x (#229)
tymofiisobchenko Feb 1, 2023
1eda678
Documentation enhancements pr 1.x (#218)
gregharvey Feb 3, 2023
09e8639
Drush refactor pr 1.x (#231)
gregharvey Feb 3, 2023
3ba2fe0
Drush refactor pr 1.x (#234)
gregharvey Feb 17, 2023
75ff9ee
Drush refactor pr 1.x (#236)
gregharvey Feb 17, 2023
8d02260
Change php detection for fastcgi and cachetool pr 1.x (#238)
tymofiisobchenko Mar 6, 2023
7971ce7
Cachetool bin per site pr 1.x (#243)
tymofiisobchenko Mar 14, 2023
31c3197
apcu no longer has an 'all' option. (#245)
gregharvey Mar 14, 2023
b5fed24
Refactoring cachetool path setting to match other squashfs vars. (#247)
gregharvey Mar 15, 2023
459689f
Cachetool pr 1.x (#249)
gregharvey Mar 15, 2023
0b39b64
Ensuring we can prevent features and ctools deployments in Drupal 7. …
gregharvey Mar 15, 2023
3d6172a
Cachetool pr 1.x (#251)
gregharvey Mar 15, 2023
2d634f4
improving_old_builds_cleanup
tymofiisobchenko Mar 20, 2023
655f6d8
fixing conflicts
tymofiisobchenko Mar 20, 2023
28e963d
Merge branch 'improving_old_builds_cleanup' into improving_old_builds…
tymofiisobchenko Mar 20, 2023
66ed953
Merge branch 'devel' into improving_old_builds_cleanup-PR-devel
tymofiisobchenko Mar 20, 2023
e960e1e
improving_old_builds_cleanup_fix
tymofiisobchenko Mar 20, 2023
15737c4
Merge branch 'improving_old_builds_cleanup' into improving_old_builds…
tymofiisobchenko Mar 20, 2023
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
2 changes: 2 additions & 0 deletions roles/_init/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ mautic:
image_path: "media/images"
force_install: false
bin_directory: "/home/{{ deploy_user }}/.bin"
# Number of dumps/db to look up for cleanup.
cleanup_history_depth: 50
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
ansible.builtin.file:
path: "{{ mysql_backup.dumps_directory }}/{{ _mysql_host }}/{{ database.database }}-{{ item }}.sql.bz2"
state: absent
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - mysql_backup.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - mysql_backup.keep, 0] | max }}
run_once: true
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
# We assume it's safe to only go back 50 build back.
- name: Delete mysql databases.
community.mysql.mysql_db:
name: "{{ database.database }}_{{ item }}"
state: absent
login_host: "{{ _mysql_host }}"
login_user: "{{ _mysql_user }}"
login_password: "{{ _mysql_password }}"
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - mysql_backup.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - mysql_backup.keep, 0] | max }}
run_once: true
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

- ansible.builtin.include_tasks: "cleanup-{{ mysql_backup.handling }}.yml"

# We assume it's safe to only go back 50 build back.
- name: Delete mysql users.
community.mysql.mysql_user:
name: "{{ database.user }}_{{ item }}"
Expand All @@ -24,6 +23,6 @@
login_host: "{{ _mysql_host }}"
login_user: "{{ _mysql_user }}"
login_password: "{{ _mysql_password }}"
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - mysql_backup.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - mysql_backup.keep, 0] | max }}
when: mysql_backup.credentials_handling == 'rotate'
run_once: true
10 changes: 5 additions & 5 deletions roles/deploy_code/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
- name: Ensure codebase is writable.
ansible.builtin.shell:
cmd: "if [ -d {{ deploy_path_prefix }}{{ item }} ]; then chmod -R 777 {{ deploy_path_prefix }}{{ item }}; fi"
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
become: true
when: "www_user != deploy_user"

- name: Ensure permissions are set on deploy directory.
ansible.builtin.shell:
cmd: "if [ -d {{ deploy_path_prefix }}{{ item }}/{{ deploy_code.perms_fix_path }} ]; then chmod 755 {{ deploy_path_prefix }}{{ item }}/{{ deploy_code.perms_fix_path }}; fi"
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
when:
- deploy_code.perms_fix_path is defined
- deploy_code.perms_fix_path | length > 1
Expand All @@ -18,7 +18,7 @@
- name: Ensure permissions are set on builds directory.
ansible.builtin.shell:
cmd: "if [ -d {{ build_path_prefix }}{{ item }}/{{ deploy_code.perms_fix_path }} ]; then chmod 755 {{ build_path_prefix }}{{ item }}/{{ deploy_code.perms_fix_path }}; fi"
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
when:
- deploy_code.perms_fix_path is defined
- deploy_code.perms_fix_path | length > 1
Expand All @@ -28,15 +28,15 @@
ansible.builtin.file:
name: "{{ deploy_path_prefix }}{{ item }}"
state: absent
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
when:
- deploy_code.mount_type != "squashfs"

- name: Delete codebases from builds directory.
ansible.builtin.file:
name: "{{ build_path_prefix }}{{ item }}"
state: absent
with_sequence: start={{ [previous_build_number | int - 50, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
with_sequence: start={{ [previous_build_number | int - cleanup_history_depth, 0] | max }} end={{ [previous_build_number | int - deploy_code.keep, 0] | max }}
when:
- deploy_code.mount_type == "squashfs"

Expand Down