@@ -18,6 +18,8 @@ package e2e
1818
1919import (
2020 "fmt"
21+ "os"
22+ "path/filepath"
2123 "strings"
2224 "testing"
2325
@@ -60,6 +62,23 @@ or remove sensitive data from your Compose configuration
6062 assert .Assert (t , strings .Contains (res .Combined (), "test/test published" ), res .Combined ())
6163 })
6264
65+ t .Run ("publish success short-form port mapping" , func (t * testing.T ) {
66+ dir := t .TempDir ()
67+ composePath := filepath .Join (dir , "compose-short-port.yml" )
68+ err := os .WriteFile (composePath , []byte (`services:
69+ whoami:
70+ image: docker.io/traefik/whoami:v1.11
71+ ports:
72+ - ${DASHBOARD_PORT:-3000}:3000
73+ ` ), 0o600 )
74+ assert .NilError (t , err )
75+
76+ res := c .RunDockerComposeCmd (t , "-f" , composePath ,
77+ "-p" , projectName , "publish" , "test/test" , "--with-env" , "-y" , "--dry-run" )
78+ assert .Assert (t , strings .Contains (res .Combined (), "test/test publishing" ), res .Combined ())
79+ assert .Assert (t , strings .Contains (res .Combined (), "test/test published" ), res .Combined ())
80+ })
81+
6382 t .Run ("publish with extends" , func (t * testing.T ) {
6483 res := c .RunDockerComposeCmd (t , "-f" , "./fixtures/publish/compose-with-extends.yml" ,
6584 "-p" , projectName , "publish" , "test/test" , "--dry-run" )
0 commit comments