fix: Use separate variable git_repo_url to avoid recursive loop
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been cancelled
🚀 Build & Deploy Image / Determine Build Necessity (push) Has been cancelled
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
🚀 Build & Deploy Image / Build Docker Image (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been cancelled
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been cancelled
🚀 Build & Deploy Image / Determine Build Necessity (push) Has been cancelled
- Use git_repo_url instead of git_repository_url in tasks - Set git_repo_url based on whether git_repository_url is provided - This completely avoids the recursive loop issue
This commit is contained in:
@@ -21,7 +21,18 @@
|
||||
tasks:
|
||||
- name: Set git_repository_url if not provided
|
||||
set_fact:
|
||||
git_repository_url: "{{ git_repository_url | default(git_repository_url_default) }}"
|
||||
git_repo_url: "{{ git_repository_url | default(git_repository_url_default) }}"
|
||||
when: git_repository_url is not defined or git_repository_url == ""
|
||||
|
||||
- name: Use default git_repository_url if not set
|
||||
set_fact:
|
||||
git_repo_url: "{{ git_repository_url_default }}"
|
||||
when: git_repository_url is not defined or git_repository_url == ""
|
||||
|
||||
- name: Use provided git_repository_url if set
|
||||
set_fact:
|
||||
git_repo_url: "{{ git_repository_url }}"
|
||||
when: git_repository_url is defined and git_repository_url != ""
|
||||
|
||||
- name: Ensure Git is installed
|
||||
ansible.builtin.apt:
|
||||
@@ -46,7 +57,7 @@
|
||||
|
||||
- name: Clone repository (if not exists)
|
||||
ansible.builtin.git:
|
||||
repo: "{{ git_repository_url }}"
|
||||
repo: "{{ git_repo_url }}"
|
||||
dest: "{{ application_code_dest }}"
|
||||
version: "{{ git_branch }}"
|
||||
force: no
|
||||
@@ -61,7 +72,7 @@
|
||||
|
||||
- name: Update repository (if exists)
|
||||
ansible.builtin.git:
|
||||
repo: "{{ git_repository_url }}"
|
||||
repo: "{{ git_repo_url }}"
|
||||
dest: "{{ application_code_dest }}"
|
||||
version: "{{ git_branch }}"
|
||||
force: yes
|
||||
|
||||
Reference in New Issue
Block a user