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
19 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion roles/deploy_code/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ deploy_code:
templates: []
# Number of builds to keep. Note this is independant of databases/dump.
keep: 10
# Wether to sync the local deploy base to a shared destination, after successful build.
# Whether to sync the local deploy base to a shared destination, after successful build.
mount_sync: ""
# Type of file to use for sync - 'squashfs' or 'tarball'
mount_type: ""
# mount_sync: "/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/deploy"
# Path that you want to make sure has 755 permissions. Make sure to include the webroot WITHOUT the slash.
perms_fix_path: ""
Expand Down
26 changes: 25 additions & 1 deletion roles/deploy_code/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type is defined
- deploy_code.mount_type == "tarball"
run_once: true

- name: Create a SquashFS image of the deployed codebases.
ansible.builtin.command:
cmd: "mksquashfs {{ deploy_base_path }} /tmp/{{ project_name }}_{{ build_type }}.sqsh"
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type is defined
- deploy_code.mount_type == "squashfs"
run_once: true

- name: Create destination folder.
Expand All @@ -38,12 +50,24 @@
- deploy_code.mount_sync | length > 1
run_once: true

- name: Move to final destination.
- name: Move tar file to final destination.
ansible.builtin.command:
cmd: "mv /tmp/{{ project_name }}_{{ build_type }}.tar {{ deploy_code.mount_sync }}/{{ project_name }}_{{ build_type }}.tar"
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type is defined
- deploy_code.mount_type == "tarball"
run_once: true

- name: Move SquashFS image to final destination.
ansible.builtin.command:
cmd: "mv /tmp/{{ project_name }}_{{ build_type }}.sqsh {{ deploy_code.mount_sync }}/{{ project_name }}_{{ build_type }}.sqsh"
when:
- deploy_code.mount_sync is defined
- deploy_code.mount_sync | length > 1
- deploy_code.mount_type is defined
- deploy_code.mount_type == "squashfs"
run_once: true

- name: Trigger an infrastructure rebuild.
Expand Down