mirror of
https://github.com/docker/compose.git
synced 2025-07-21 20:54:32 +02:00
add support for COMPOSE_PROFILES
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
d625f08a70
commit
2f6a636670
@ -19,6 +19,7 @@ package compose
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/cli"
|
"github.com/compose-spec/compose-go/cli"
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
@ -84,6 +85,10 @@ func (o *projectOptions) toProject(services []string, po ...cli.ProjectOptionsFn
|
|||||||
o.Profiles = append(o.Profiles, s.GetProfiles()...)
|
o.Profiles = append(o.Profiles, s.GetProfiles()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if profiles, ok := options.Environment["COMPOSE_PROFILES"]; ok {
|
||||||
|
o.Profiles = append(o.Profiles, strings.Split(profiles, ",")...)
|
||||||
|
}
|
||||||
|
|
||||||
project.ApplyProfiles(o.Profiles)
|
project.ApplyProfiles(o.Profiles)
|
||||||
|
|
||||||
err = project.ForServices(services)
|
err = project.ForServices(services)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user