File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 3535 - name : Modify Docker Compose for CI
3636 run : |
3737 cp docker-compose.yaml docker-compose.ci.yaml
38- # For the backend service
39- yq eval '.services. backend.extra_hosts += ["host.docker.internal:host-gateway"]' -i docker-compose.ci .yaml
38+ # For the backend service (extra_hosts already exists, skip it)
39+ # Note: backend.environment is a list in docker-compose.yaml
4040 yq eval '.services.backend.environment += ["TESTING=true"]' -i docker-compose.ci.yaml
4141 yq eval '.services.backend.environment += ["MONGO_ROOT_USER=testroot"]' -i docker-compose.ci.yaml
4242 yq eval '.services.backend.environment += ["MONGO_ROOT_PASSWORD=testpassword"]' -i docker-compose.ci.yaml
4848 yq eval '.services.mongo.environment.MONGO_INITDB_ROOT_PASSWORD = "testpassword"' -i docker-compose.ci.yaml
4949
5050 # For the cert-generator service
51- yq eval '.services.cert-generator.extra_hosts += ["host.docker.internal:host-gateway"]' -i docker-compose.ci.yaml
52- yq eval '.services.cert-generator.environment += ["CI=true"]' -i docker-compose.ci.yaml
53- yq eval '.services.cert-generator.volumes += ["$HOME/.kube/config:/root/.kube/config:ro"]' -i docker-compose.ci.yaml
51+ # Check if extra_hosts exists, if not create it as a list
52+ yq eval 'select(.services."cert-generator".extra_hosts == null).services."cert-generator".extra_hosts = []' -i docker-compose.ci.yaml
53+ yq eval '.services."cert-generator".extra_hosts += ["host.docker.internal:host-gateway"]' -i docker-compose.ci.yaml
54+ yq eval '.services."cert-generator".environment += ["CI=true"]' -i docker-compose.ci.yaml
55+ yq eval '.services."cert-generator".volumes += [env(HOME) + "/.kube/config:/root/.kube/config:ro"]' -i docker-compose.ci.yaml
5456
5557 echo "--- Modified docker-compose.ci.yaml ---"
5658 cat docker-compose.ci.yaml
You can’t perform that action at this time.
0 commit comments