Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Changes from all commits
Commits
Show all changes
86 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
20774f6
Adding SquashFS option to syncing.
gregharvey Jun 13, 2022
a684f74
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 13, 2022
53e6443
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 13, 2022
7f3e750
Make 'tarball' the default mount type so nothing existing breaks.
gregharvey Jun 13, 2022
f857383
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 13, 2022
2ec37f2
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 13, 2022
0b17bb5
Altering deploy_path so we can build in another location for SquashFS…
gregharvey Jun 14, 2022
eb54cb9
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 14, 2022
dcdf35f
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 14, 2022
0b380de
Ensuring the build dir exists if doing a SquashFS build.
gregharvey Jun 14, 2022
57f41a2
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 14, 2022
7d8a9ac
Force symlink creation as the deploy dir may not exist yet.
gregharvey Jun 14, 2022
fce73e8
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 14, 2022
085d709
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 14, 2022
307ac67
Running mount commands with sudo.
gregharvey Jun 15, 2022
bc90244
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 15, 2022
062afb9
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 15, 2022
4424413
Tweaking link command and destination for live links.
gregharvey Jun 15, 2022
874faa0
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 15, 2022
2884743
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 15, 2022
7e39641
Slight bug in link path handling for SquashFS.
gregharvey Jun 15, 2022
a421ba0
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 15, 2022
ca67307
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 15, 2022
2bb6459
Checking for existing mount and using remount operation.
gregharvey Jun 15, 2022
c219cdb
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 15, 2022
6c7c4ed
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 15, 2022
f076147
Stop ce-deploy trying to delete from read-only SquashFS mount.
gregharvey Jun 15, 2022
622f686
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 15, 2022
3ced700
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 15, 2022
6c7d2c9
Formatting error, these special jinja2 things are not filters - no sp…
gregharvey Jun 15, 2022
e53308e
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 15, 2022
fec8f01
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 15, 2022
5e145d4
Reloading services to make sure mounting doesn't fail.
gregharvey Jun 16, 2022
3ab9a57
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 16, 2022
57a5cea
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 16, 2022
57ed6e3
Picking more sensible loop var name.
gregharvey Jun 16, 2022
bb185a4
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 16, 2022
1b66af2
Moving to shell for mount check and fixing jinja2 filter names.
gregharvey Jun 16, 2022
dbe45ca
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 16, 2022
74466c0
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 16, 2022
9db2899
Trying with the posix mount module instead of command.
gregharvey Jun 16, 2022
e77e0e5
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 16, 2022
38b69e5
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 16, 2022
169a5f7
Working through user/sudo issues.
gregharvey Jun 16, 2022
ba6cf37
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 16, 2022
bfeeb4f
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 16, 2022
42f12c8
Attempt to fix syncs whenever the 'dump' type is used for source or t…
EmlynK Jun 16, 2022
e878aab
Altering symlink handling slightly so we have the deploy directory al…
gregharvey Jun 16, 2022
d56accb
Merge branch '1.x' into squashfs
gregharvey Jun 16, 2022
32ad61f
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 16, 2022
a46b13d
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 16, 2022
c45db1d
Simplifying 'when' checks.
gregharvey Jun 16, 2022
eaf730e
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 16, 2022
a9c6abf
Squashfs pr 1.x (#150)
gregharvey Jun 20, 2022
b930652
Adding a revert behaviour for SquashFS.
gregharvey Jun 23, 2022
9fbea15
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 23, 2022
d9ff97e
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 23, 2022
d8269c9
Merging 1.x.
gregharvey Jun 23, 2022
0546a34
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 23, 2022
4f7aa25
Making some wording a little less ambiguous.
gregharvey Jun 23, 2022
b5f8fcb
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 23, 2022
7be01a2
Fixing bad image path and adding clauses to stat check.
gregharvey Jun 29, 2022
a2acd22
Merge branch 'devel' into squashfs-PR-devel
gregharvey Jun 29, 2022
1fd3882
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 29, 2022
1f12a90
Trying to make remounting SquashFS images a bit safer.
gregharvey Jun 29, 2022
4f14ce4
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 29, 2022
edf02be
Adding when clauses to SquashFS image path check.
gregharvey Jun 29, 2022
41aea1c
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 29, 2022
abe7fe4
Removing revert code, as it cannot work.
gregharvey Jun 29, 2022
afe075c
Merge branch 'squashfs' into squashfs-PR-devel
gregharvey Jun 29, 2022
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
64 changes: 42 additions & 22 deletions roles/deploy_code/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@
- deploy_code.mount_type == "tarball"
run_once: true

- name: Ensure older SquashFS images are deleted.
ansible.builtin.file:
path: "{{ build_base_path }}/deploy.sqsh"
state: absent
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"
run_once: true

- name: Create a SquashFS image of the deployed codebases.
ansible.builtin.command:
cmd: "mksquashfs {{ build_base_path }} /tmp/{{ project_name }}_{{ build_type }}.sqsh"
Expand Down Expand Up @@ -96,6 +86,36 @@
- deploy_code.mount_type == "squashfs"
run_once: true

- name: Check if we have a SquashFS image already there.
ansible.builtin.stat:
path: "{{ build_base_path }}/deploy.sqsh"
register: _deploy_code_mount_image
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"

- name: Copy previous SquashFS image in case of rollback.
ansible.builtin.copy:
remote_src: true
force: true
src: "{{ build_base_path }}/deploy.sqsh"
dest: "{{ build_base_path }}/deploy_previous.sqsh"
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"
- _deploy_code_mount_image.stat.islnk is defined

- name: Ensure mounted SquashFS image is deleted.
ansible.builtin.file:
path: "{{ build_base_path }}/deploy.sqsh"
state: absent
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"

- name: Copy SquashFS image to local server.
ansible.builtin.command:
cmd: "cp {{ deploy_code.mount_sync }}/{{ project_name }}_{{ build_type }}.sqsh {{ build_base_path }}/deploy.sqsh"
Expand All @@ -108,21 +128,11 @@
ansible.builtin.shell:
cmd: "mount | grep {{ deploy_base_path }}"
ignore_errors: true
register: _mount_check
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"

- name: Unmount existing SquashFS image.
ansible.builtin.command:
cmd: "umount -l {{ deploy_base_path }}"
become: true
register: _deploy_code_mount_check
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"
- _mount_check is succeeded

- name: Reload any services that might be keeping the loop device busy.
ansible.builtin.service:
Expand All @@ -136,9 +146,19 @@
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"
- _mount_check is succeeded
- _deploy_code_mount_check is succeeded
- deploy_code.services | length > 0

- name: Unmount existing SquashFS image.
ansible.builtin.command:
cmd: "umount {{ deploy_base_path }}"
become: true
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type == "squashfs"
- _deploy_code_mount_check is succeeded

- name: Mount new SquashFS image.
ansible.builtin.command:
cmd: "mount {{ build_base_path }}/deploy.sqsh {{ deploy_base_path }} -t squashfs -o loop"
Expand Down