mirror of
https://github.com/docker/compose.git
synced 2025-07-26 23:24:05 +02:00
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 (
|
const (
|
||||||
ProjectTag = "com.docker.compose.project"
|
ProjectTag = "com.docker.compose.project"
|
||||||
NetworkTag = "com.docker.compose.network"
|
NetworkTag = "com.docker.compose.network"
|
||||||
|
ServiceTag = "com.docker.compose.service"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewClient(profile string, cluster string, region string) (compose.API, error) {
|
func NewClient(profile string, cluster string, region string) (compose.API, error) {
|
||||||
|
@ -183,6 +183,16 @@ func (c client) Convert(project *compose.Project) (*cloudformation.Template, err
|
|||||||
SchedulingStrategy: ecsapi.SchedulingStrategyReplica,
|
SchedulingStrategy: ecsapi.SchedulingStrategyReplica,
|
||||||
ServiceName: service.Name,
|
ServiceName: service.Name,
|
||||||
ServiceRegistries: []ecs.Service_ServiceRegistry{serviceRegistry},
|
ServiceRegistries: []ecs.Service_ServiceRegistry{serviceRegistry},
|
||||||
|
Tags: []tags.Tag{
|
||||||
|
{
|
||||||
|
Key: ProjectTag,
|
||||||
|
Value: project.Name,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Key: ServiceTag,
|
||||||
|
Value: service.Name,
|
||||||
|
},
|
||||||
|
},
|
||||||
TaskDefinition: cloudformation.Ref(taskDefinition),
|
TaskDefinition: cloudformation.Ref(taskDefinition),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"Tags": [
|
||||||
|
{
|
||||||
|
"Key": "com.docker.compose.project",
|
||||||
|
"Value": "TestSimpleConvert"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key": "com.docker.compose.service",
|
||||||
|
"Value": "simple"
|
||||||
|
}
|
||||||
|
],
|
||||||
"TaskDefinition": {
|
"TaskDefinition": {
|
||||||
"Ref": "simpleTaskDefinition"
|
"Ref": "simpleTaskDefinition"
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"Tags": [
|
||||||
|
{
|
||||||
|
"Key": "com.docker.compose.project",
|
||||||
|
"Value": "TestSimpleWithOverrides"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key": "com.docker.compose.service",
|
||||||
|
"Value": "simple"
|
||||||
|
}
|
||||||
|
],
|
||||||
"TaskDefinition": {
|
"TaskDefinition": {
|
||||||
"Ref": "simpleTaskDefinition"
|
"Ref": "simpleTaskDefinition"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user