fix: Don't start containers in install-composer-dependencies playbook
Some checks failed
🚀 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
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
🚀 Build & Deploy Image / Determine Build Necessity (push) Has been cancelled
Some checks failed
🚀 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
Security Vulnerability Scan / Check for Dependency Changes (push) Has been cancelled
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
🚀 Build & Deploy Image / Determine Build Necessity (push) Has been cancelled
- Remove container start logic - containers should be started by deploy-image.yml - Add clear error message if container is not running - Provides helpful instructions for manual container start if needed
This commit is contained in:
@@ -47,13 +47,21 @@
|
|||||||
debug:
|
debug:
|
||||||
msg: "Container status: {{ container_status.stdout }}"
|
msg: "Container status: {{ container_status.stdout }}"
|
||||||
|
|
||||||
- name: Start container if not running
|
- name: Fail if container is not running
|
||||||
shell: |
|
fail:
|
||||||
|
msg: |
|
||||||
|
Container '{{ php_service_name }}' is not running!
|
||||||
|
|
||||||
|
The container must be started before installing composer dependencies.
|
||||||
|
This is typically done by the 'deploy-image.yml' playbook which should run before this.
|
||||||
|
|
||||||
|
To start the container manually:
|
||||||
cd {{ application_code_dest }}
|
cd {{ application_code_dest }}
|
||||||
docker compose -f docker-compose.base.yml -f docker-compose.{{ application_compose_suffix }} up -d {{ php_service_name }}
|
docker compose -f docker-compose.base.yml -f docker-compose.{{ application_compose_suffix }} up -d {{ php_service_name }}
|
||||||
|
|
||||||
|
Note: The container requires environment variables (DB_USERNAME, DB_PASSWORD, etc.)
|
||||||
|
which should be set in a .env file or via docker-compose environment configuration.
|
||||||
when: container_status.rc != 0 or '"State":"running"' not in container_status.stdout
|
when: container_status.rc != 0 or '"State":"running"' not in container_status.stdout
|
||||||
register: container_start
|
|
||||||
changed_when: container_start.rc == 0
|
|
||||||
|
|
||||||
- name: Install composer dependencies in PHP container
|
- name: Install composer dependencies in PHP container
|
||||||
shell: |
|
shell: |
|
||||||
|
|||||||
Reference in New Issue
Block a user