-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add support for "host:port" forwardPorts syntax
fixes: #305
- Loading branch information
1 parent
99a4b23
commit 24d7db2
Showing
8 changed files
with
254 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package framework | ||
|
||
import ( | ||
"net" | ||
"net/http" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
const agentServerPort = "9191" | ||
|
||
func StartAgentServer() error { | ||
wd, err := os.Getwd() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
listener, err := net.Listen("tcp", ":"+agentServerPort) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
err = os.Setenv("DEVPOD_AGENT_URL", "http://localhost:"+agentServerPort) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if err := http.Serve(listener, http.FileServer(http.Dir(filepath.Join(wd, "bin")))); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
12 changes: 12 additions & 0 deletions
12
e2e/tests/up/testdata/docker-compose-forward-ports/.devcontainer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "Go", | ||
"dockerComposeFile": "./docker-compose.yaml", | ||
"service": "app", | ||
"runServices": ["nginx"], | ||
"workspaceFolder": "/workspaces", | ||
"forwardPorts": [ | ||
4000, | ||
"3000", | ||
"nginx:8989" | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
e2e/tests/up/testdata/docker-compose-forward-ports/docker-compose.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '3' | ||
|
||
services: | ||
app: | ||
image: mcr.microsoft.com/devcontainers/go:0-1.19-bullseye | ||
command: sleep infinity | ||
volumes: | ||
- .:/workspaces:cached | ||
nginx: | ||
image: nginx | ||
ports: | ||
- "8989:80" |
Oops, something went wrong.