refactor: Simplify git_repo_url logic
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 59s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 26s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 10s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 12s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 48s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 59s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 26s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 10s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 12s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 48s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Use single set_fact task with ternary operator - Cleaner and more efficient than multiple conditional tasks
This commit is contained in:
@@ -19,20 +19,9 @@
|
||||
deployment_environment: "{{ deployment_environment | default('production') }}"
|
||||
|
||||
tasks:
|
||||
- name: Set git_repository_url if not provided
|
||||
- name: Set git_repo_url from provided value or default
|
||||
set_fact:
|
||||
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 != ""
|
||||
git_repo_url: "{{ git_repository_url if (git_repository_url is defined and git_repository_url != '') else git_repository_url_default }}"
|
||||
|
||||
- name: Ensure Git is installed
|
||||
ansible.builtin.apt:
|
||||
|
||||
Reference in New Issue
Block a user