Update postgres-service.yml

This commit is contained in:
Chris Patterson
2019-09-05 11:49:18 -04:00
committed by GitHub
parent dfd84e0637
commit db907008e7

View File

@@ -12,6 +12,8 @@ jobs:
container-job:
runs-on: ubuntu-latest
# runs all of the steps inside the specified continer rather than on the VM host.
# Because of this the network configuration changes from host based network to a container network.
container:
image: node:10.16-jessie
@@ -34,11 +36,13 @@ jobs:
- run: node client.js
working-directory: ./postgres
env:
# use postgres for the host here because we have specified a contaienr for the job.
# use postgres for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be localhost
POSTGRES_HOST: postgres
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
# Runs all steps on the VM
# The service containers will use host port binding instead of container networking so you access them via localhost rather than the service name
vm-job:
runs-on: ubuntu-latest
@@ -62,7 +66,7 @@ jobs:
- run: node client.js
working-directory: ./postgres
env:
# use postgres for the host here because we have specified a contaienr for the job.
# If we were running the job on the VM this would be localhost
# use localhost for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port