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
|
- name: Setup DinD environment
|
||||||
run: |
|
run: |
|
||||||
# Start DinD container using our compose file
|
# Start DinD container for isolated Docker operations
|
||||||
cd /opt/${{ secrets.APP_NAME || 'sharenet' }}
|
docker run -d \
|
||||||
docker compose -f ci-cd-compose.yml up -d
|
--name ci-cd-build-dind \
|
||||||
|
--privileged \
|
||||||
|
-p 2375:2375 \
|
||||||
|
-e DOCKER_TLS_CERTDIR="" \
|
||||||
|
docker:dind
|
||||||
|
|
||||||
# Wait for DinD to be ready
|
# Wait for DinD to be ready
|
||||||
echo "Waiting for DinD container 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)
|
# 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-build-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 'kill -HUP 1'
|
||||||
|
|
||||||
# Wait for Docker daemon to reload
|
# Wait for Docker daemon to reload
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
# Verify DinD is working
|
# Verify DinD is working
|
||||||
docker exec ci-cd-dind docker version
|
docker exec ci-cd-build-dind docker version
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
@ -178,8 +182,9 @@ jobs:
|
||||||
- name: Cleanup DinD environment
|
- name: Cleanup DinD environment
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
cd /opt/${{ secrets.APP_NAME || 'sharenet' }}
|
# Stop and remove DinD container
|
||||||
docker compose -f ci-cd-compose.yml down
|
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)
|
# Job 3: Deployment - Runs directly on production runner (no DinD needed)
|
||||||
deploy:
|
deploy:
|
||||||
|
|
Loading…
Add table
Reference in a new issue