fix: Fix bool comparison and .env file permissions
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 58s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 34s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 12s
🚀 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 14s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 1m6s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 58s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 34s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 12s
🚀 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 14s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 1m6s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
- Change registry_accessible to string comparison ('true'/'false') instead of bool
- Fix 'argument of type bool is not iterable' error in when conditions
- Set correct owner/group for .env file (ansible_user instead of root)
- Fixes 'permission denied' error when docker compose reads .env file
This commit is contained in:
@@ -80,12 +80,7 @@
|
|||||||
|
|
||||||
- name: Set registry accessible flag
|
- name: Set registry accessible flag
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
registry_accessible: >-
|
registry_accessible: "{{ 'true' if (registry_check.status is defined and registry_check.status | int in [200, 401]) else 'false' }}"
|
||||||
{%- if registry_check.status is defined and registry_check.status | int in [200, 401] -%}
|
|
||||||
true
|
|
||||||
{%- else -%}
|
|
||||||
false
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
- name: Login to Docker registry
|
- name: Login to Docker registry
|
||||||
community.docker.docker_login:
|
community.docker.docker_login:
|
||||||
@@ -94,7 +89,7 @@
|
|||||||
password: "{{ registry_password }}"
|
password: "{{ registry_password }}"
|
||||||
when:
|
when:
|
||||||
- registry_password | string | trim != ''
|
- registry_password | string | trim != ''
|
||||||
- registry_accessible | bool
|
- registry_accessible == 'true'
|
||||||
no_log: yes
|
no_log: yes
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: docker_login_result
|
register: docker_login_result
|
||||||
@@ -104,7 +99,7 @@
|
|||||||
name: "{{ deploy_image }}"
|
name: "{{ deploy_image }}"
|
||||||
source: pull
|
source: pull
|
||||||
pull: true
|
pull: true
|
||||||
when: registry_accessible is defined and registry_accessible | bool
|
when: registry_accessible == 'true'
|
||||||
register: image_pull_result
|
register: image_pull_result
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
failed_when: false
|
failed_when: false
|
||||||
@@ -159,6 +154,8 @@
|
|||||||
MINIO_ROOT_USER={{ minio_root_user | default('minioadmin') }}
|
MINIO_ROOT_USER={{ minio_root_user | default('minioadmin') }}
|
||||||
MINIO_ROOT_PASSWORD={{ minio_root_password | default('') }}
|
MINIO_ROOT_PASSWORD={{ minio_root_password | default('') }}
|
||||||
SECRETS_DIR={{ secrets_dir | default('./secrets') }}
|
SECRETS_DIR={{ secrets_dir | default('./secrets') }}
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ ansible_user }}"
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
when: not env_file_exists.stat.exists
|
when: not env_file_exists.stat.exists
|
||||||
become: yes
|
become: yes
|
||||||
|
|||||||
Reference in New Issue
Block a user