@@ -458,37 +458,18 @@ jobs:
458458 - name : Set system env variable to github env
459459 run : echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
460460 - name : Set github token, hostname, port and docker network for self-hosted runner
461- if : env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
462- run : |
463- {
464- echo "POSTGRES_HOSTNAME=postgres_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}"
465- echo "POSTGRES_PORT=5432"
466- #echo "REDIS_HOSTNAME=redis_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}"
467- #echo "REDIS_PORT=6379"
468- } >> "$GITHUB_ENV"
469- docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
470- #docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} redis_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}
471-
472- # # Only set Redis variables and connect to Redis if redis_enable is true
473- # if [ "${{ inputs.redis_enable }}" == "true" ]; then
474- # echo "REDIS_HOSTNAME=redis_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}" >> "$GITHUB_ENV"
475- # echo "REDIS_PORT=6379" >> "$GITHUB_ENV"
476- # source "$GITHUB_ENV"
477- # echo "Redis Hostname: $REDIS_HOSTNAME"
478- # #docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.REDIS_HOSTNAME }}
479- # docker network connect "${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }}" "$REDIS_HOSTNAME" # Properly reference the hostname
480-
481- # fi
482- - name : Set redis hostname, port and docker network for self-hosted runner
483461 if : env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
484462 env :
485463 REDIS_HOSTNAME : redis_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}
486464 REDIS_PORT : 6379
487465 run : |
488466 {
467+ echo "POSTGRES_HOSTNAME=postgres_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}"
468+ echo "POSTGRES_PORT=5432"
489469 echo "REDIS_HOSTNAME=redis_${{ github.job }}_${{ inputs.deduplication_id }}_${{ github.run_id }}_${{ github.run_attempt }}"
490470 echo "REDIS_PORT=6379"
491471 } >> "$GITHUB_ENV"
472+ docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
492473 docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.REDIS_HOSTNAME }}
493474
494475 - name : Set service connection details to hosted runner
0 commit comments