fix: Set git_repository_url using set_fact to avoid recursive loop
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 33s
🚀 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 / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 33s
🚀 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 / Build Runtime Base Image (push) Has been cancelled
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
- Use set_fact task to set git_repository_url instead of vars section - This prevents recursive loop when variable is referenced in tasks
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
vars:
|
vars:
|
||||||
application_code_dest: "/home/deploy/michaelschiemer/current"
|
application_code_dest: "/home/deploy/michaelschiemer/current"
|
||||||
git_repository_url_default: "https://git.michaelschiemer.de/michael/michaelschiemer.git"
|
git_repository_url_default: "https://git.michaelschiemer.de/michael/michaelschiemer.git"
|
||||||
git_repository_url: "{{ git_repository_url | default(git_repository_url_default) }}"
|
|
||||||
# Determine branch based on environment
|
# Determine branch based on environment
|
||||||
git_branch: >-
|
git_branch: >-
|
||||||
{%- if deployment_environment == 'staging' -%}
|
{%- if deployment_environment == 'staging' -%}
|
||||||
@@ -20,6 +19,10 @@
|
|||||||
deployment_environment: "{{ deployment_environment | default('production') }}"
|
deployment_environment: "{{ deployment_environment | default('production') }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Set git_repository_url if not provided
|
||||||
|
set_fact:
|
||||||
|
git_repository_url: "{{ git_repository_url | default(git_repository_url_default) }}"
|
||||||
|
|
||||||
- name: Ensure Git is installed
|
- name: Ensure Git is installed
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: git
|
name: git
|
||||||
|
|||||||
Reference in New Issue
Block a user