mirror of https://github.com/docker/compose.git
Create service with project and service tags
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
01e2b0c989
commit
257f829679
|
@ -9,6 +9,7 @@ import (
|
|||
const (
|
||||
ProjectTag = "com.docker.compose.project"
|
||||
NetworkTag = "com.docker.compose.network"
|
||||
ServiceTag = "com.docker.compose.service"
|
||||
)
|
||||
|
||||
func NewClient(profile string, cluster string, region string) (compose.API, error) {
|
||||
|
|
|
@ -183,7 +183,17 @@ func (c client) Convert(project *compose.Project) (*cloudformation.Template, err
|
|||
SchedulingStrategy: ecsapi.SchedulingStrategyReplica,
|
||||
ServiceName: service.Name,
|
||||
ServiceRegistries: []ecs.Service_ServiceRegistry{serviceRegistry},
|
||||
TaskDefinition: cloudformation.Ref(taskDefinition),
|
||||
Tags: []tags.Tag{
|
||||
{
|
||||
Key: ProjectTag,
|
||||
Value: project.Name,
|
||||
},
|
||||
{
|
||||
Key: ServiceTag,
|
||||
Value: service.Name,
|
||||
},
|
||||
},
|
||||
TaskDefinition: cloudformation.Ref(taskDefinition),
|
||||
}
|
||||
}
|
||||
return template, nil
|
||||
|
|
|
@ -123,6 +123,16 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
"Tags": [
|
||||
{
|
||||
"Key": "com.docker.compose.project",
|
||||
"Value": "TestSimpleConvert"
|
||||
},
|
||||
{
|
||||
"Key": "com.docker.compose.service",
|
||||
"Value": "simple"
|
||||
}
|
||||
],
|
||||
"TaskDefinition": {
|
||||
"Ref": "simpleTaskDefinition"
|
||||
}
|
||||
|
|
|
@ -123,6 +123,16 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
"Tags": [
|
||||
{
|
||||
"Key": "com.docker.compose.project",
|
||||
"Value": "TestSimpleWithOverrides"
|
||||
},
|
||||
{
|
||||
"Key": "com.docker.compose.service",
|
||||
"Value": "simple"
|
||||
}
|
||||
],
|
||||
"TaskDefinition": {
|
||||
"Ref": "simpleTaskDefinition"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue