Scott Hiett commited on
Commit
db3de59
·
1 Parent(s): 2782522

Docker run networking improvements

Browse files
Files changed (1) hide show
  1. .github/workflows/test.yml +11 -7
.github/workflows/test.yml CHANGED
@@ -35,8 +35,6 @@ jobs:
35
  services:
36
  redis:
37
  image: redis/redis-stack-server:6.2.6-v6 # 6.2 is the Upstash compatible Redis version
38
- ports:
39
- - 6379:6379
40
 
41
  steps:
42
  - name: Checkout code
@@ -57,13 +55,19 @@ jobs:
57
  - name: Load SRH image
58
  run: |
59
  docker load --input /tmp/serverless-redis-http.tar
60
- docker image ls -a
61
 
 
 
 
62
  - name: Run SRH container
63
- uses: addnab/docker-run-action@v3
64
- with:
65
- image: hiett/serverless-redis-http:latest
66
- options: -it -d -p 8080:80 -e SRH_MODE=env -e SRH_TOKEN=${{ env.SRH_TOKEN }} -e SRH_CONNECTION_STRING="redis://redis:6379"
 
 
 
67
 
68
  # The following tests fail because of bugs with Upstash's implementation of Redis, NOT because of our library
69
  # So we remove them from the test suite
 
35
  services:
36
  redis:
37
  image: redis/redis-stack-server:6.2.6-v6 # 6.2 is the Upstash compatible Redis version
 
 
38
 
39
  steps:
40
  - name: Checkout code
 
55
  - name: Load SRH image
56
  run: |
57
  docker load --input /tmp/serverless-redis-http.tar
58
+ docker image ls -a | grep serverless-redis-http
59
 
60
+ # Placed inside the same docker network as the service container with job.container.network, at which point
61
+ # it can directly address Redis. We still need to expose SRH's port to the host machine, however, so that
62
+ # we can run tests against it.
63
  - name: Run SRH container
64
+ run: >
65
+ docker run -it -d -p 8080:80
66
+ --network ${{ job.container.network }}
67
+ -e SRH_MODE=env
68
+ -e SRH_TOKEN=${{ env.SRH_TOKEN }}
69
+ -e SRH_CONNECTION_STRING="redis://redis:6379"
70
+ hiett/serverless-redis-http:latest
71
 
72
  # The following tests fail because of bugs with Upstash's implementation of Redis, NOT because of our library
73
  # So we remove them from the test suite