From 9fb372be5256870033da28f0c80dfaee93c5d89a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 4 Dec 2025 23:50:24 +0100 Subject: [PATCH] Implemented shallow cloning for git --- roles/desk-ssh/tasks/01_core.yml | 7 ++++--- roles/dev-yay/tasks/01_core.yml | 7 ++++--- roles/pkgmgr-install/tasks/main.yml | 2 +- roles/pkgmgr/tasks/01_core.yml | 9 +++++---- roles/web-app-discourse/tasks/03_docker.yml | 9 +++++---- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/roles/desk-ssh/tasks/01_core.yml b/roles/desk-ssh/tasks/01_core.yml index adecefbf..6ad1359b 100644 --- a/roles/desk-ssh/tasks/01_core.yml +++ b/roles/desk-ssh/tasks/01_core.yml @@ -5,9 +5,10 @@ - name: pull ssh repository from {{desk_ssh_repository}} git: - repo: "{{desk_ssh_repository}}" - dest: "$HOME/.ssh" - update: yes + repo: "{{desk_ssh_repository}}" + dest: "$HOME/.ssh" + update: yes + depth: 1 register: git_result ignore_errors: true become: false diff --git a/roles/dev-yay/tasks/01_core.yml b/roles/dev-yay/tasks/01_core.yml index 7a6114f7..22feb4d5 100644 --- a/roles/dev-yay/tasks/01_core.yml +++ b/roles/dev-yay/tasks/01_core.yml @@ -32,10 +32,11 @@ become: true become_user: "{{ AUR_BUILDER_USER }}" git: - repo: https://aur.archlinux.org/yay.git - dest: "/home/{{ AUR_BUILDER_USER }}/yay" - clone: yes + repo: https://aur.archlinux.org/yay.git + dest: "/home/{{ AUR_BUILDER_USER }}/yay" + clone: yes update: yes + depth: 1 - name: Build and install yay become: true diff --git a/roles/pkgmgr-install/tasks/main.yml b/roles/pkgmgr-install/tasks/main.yml index cb786632..69c490f1 100644 --- a/roles/pkgmgr-install/tasks/main.yml +++ b/roles/pkgmgr-install/tasks/main.yml @@ -4,7 +4,7 @@ - name: "Install '{{ package_name }}' via Kevin's Package Manager (pkgmgr)" ansible.builtin.shell: | source ~/.venvs/pkgmgr/bin/activate - pkgmgr update {{ package_name }} --dependencies --clone-mode https + pkgmgr update {{ package_name }} --dependencies --clone-mode shallow args: executable: /bin/bash notify: "{{ package_notify | default(omit,true) }}" diff --git a/roles/pkgmgr/tasks/01_core.yml b/roles/pkgmgr/tasks/01_core.yml index 45264e16..5b2c6634 100644 --- a/roles/pkgmgr/tasks/01_core.yml +++ b/roles/pkgmgr/tasks/01_core.yml @@ -29,10 +29,11 @@ - name: Clone Kevin's Package Manager repository git: - repo: "{{ PKGMGR_REPO_URL }}" - dest: "{{ PKGMGR_INSTALL_PATH }}" - version: "HEAD" - force: yes + repo: "{{ PKGMGR_REPO_URL }}" + dest: "{{ PKGMGR_INSTALL_PATH }}" + version: "HEAD" + force: yes + depth: 1 become: true - name: create config.yaml diff --git a/roles/web-app-discourse/tasks/03_docker.yml b/roles/web-app-discourse/tasks/03_docker.yml index 869e3050..9953663b 100644 --- a/roles/web-app-discourse/tasks/03_docker.yml +++ b/roles/web-app-discourse/tasks/03_docker.yml @@ -13,11 +13,12 @@ - name: pull docker repository git: - repo: "{{ DISCOURSE_REPOSITORY_URL }}" - dest: "{{ DISCOURSE_REPOSITORY_DIR }}" + repo: "{{ DISCOURSE_REPOSITORY_URL }}" + dest: "{{ DISCOURSE_REPOSITORY_DIR }}" update: yes - notify: recreate discourse - become: true + depth: 1 + notify: recreate discourse + become: true ignore_errors: true - name: set chmod 700 for '{{ DISCOURSE_CONTAINERS_DIR }}'