In the build stage of the CI pipeline, the backend and frontend build in their own isolated docker containers
Some checks are pending
CI/CD Pipeline (Fully Isolated DinD) / Test Backend and Frontend (Fully Isolated DinD) (push) Waiting to run
CI/CD Pipeline (Fully Isolated DinD) / Build and Push Docker Images (DinD) (push) Blocked by required conditions
CI/CD Pipeline (Fully Isolated DinD) / Deploy to Production (push) Blocked by required conditions
Some checks are pending
CI/CD Pipeline (Fully Isolated DinD) / Test Backend and Frontend (Fully Isolated DinD) (push) Waiting to run
CI/CD Pipeline (Fully Isolated DinD) / Build and Push Docker Images (DinD) (push) Blocked by required conditions
CI/CD Pipeline (Fully Isolated DinD) / Deploy to Production (push) Blocked by required conditions
This commit is contained in:
parent
1cba835799
commit
89789c2863
1 changed files with 14 additions and 9 deletions
|
@ -132,23 +132,27 @@ jobs:
|
|||
|
||||
- name: Setup DinD environment
|
||||
run: |
|
||||
# Start DinD container using our compose file
|
||||
cd /opt/${{ secrets.APP_NAME || 'sharenet' }}
|
||||
docker compose -f ci-cd-compose.yml up -d
|
||||
# Start DinD container for isolated Docker operations
|
||||
docker run -d \
|
||||
--name ci-cd-build-dind \
|
||||
--privileged \
|
||||
-p 2375:2375 \
|
||||
-e DOCKER_TLS_CERTDIR="" \
|
||||
docker:dind
|
||||
|
||||
# Wait for DinD to be ready
|
||||
echo "Waiting for DinD container to be ready..."
|
||||
timeout 60 bash -c 'until docker compose -f ci-cd-compose.yml ps | grep -q "healthy"; do sleep 2; done'
|
||||
timeout 60 bash -c 'until docker exec ci-cd-build-dind docker version; do sleep 2; done'
|
||||
|
||||
# Configure Docker for Harbor registry (needed for pushing images)
|
||||
docker exec ci-cd-dind sh -c 'echo "{\"insecure-registries\": [\"${{ secrets.CI_HOST }}:5000\"]}" > /etc/docker/daemon.json'
|
||||
docker exec ci-cd-dind sh -c 'kill -HUP 1'
|
||||
docker exec ci-cd-build-dind sh -c 'echo "{\"insecure-registries\": [\"${{ secrets.CI_HOST }}:5000\"]}" > /etc/docker/daemon.json'
|
||||
docker exec ci-cd-build-dind sh -c 'kill -HUP 1'
|
||||
|
||||
# Wait for Docker daemon to reload
|
||||
sleep 5
|
||||
|
||||
# Verify DinD is working
|
||||
docker exec ci-cd-dind docker version
|
||||
docker exec ci-cd-build-dind docker version
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
@ -178,8 +182,9 @@ jobs:
|
|||
- name: Cleanup DinD environment
|
||||
if: always()
|
||||
run: |
|
||||
cd /opt/${{ secrets.APP_NAME || 'sharenet' }}
|
||||
docker compose -f ci-cd-compose.yml down
|
||||
# Stop and remove DinD container
|
||||
docker stop ci-cd-build-dind || true
|
||||
docker rm ci-cd-build-dind || true
|
||||
|
||||
# Job 3: Deployment - Runs directly on production runner (no DinD needed)
|
||||
deploy:
|
||||
|
|
Loading…
Add table
Reference in a new issue