-
Notifications
You must be signed in to change notification settings - Fork 301
Add task-def and file flags to local down/ps #789
Changes from all commits
0466dd2
551e12c
46b8b94
88383b0
0329378
72a769e
520d177
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,12 +18,39 @@ package local | |
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/aws/amazon-ecs-cli/ecs-cli/modules/commands/flags" | ||
| "github.com/urfave/cli" | ||
| ) | ||
|
|
||
| const ( | ||
| // taskDefinitionLabelType represents the type of option used to | ||
| // transform a task definition to a compose file e.g. remoteFile, localFile. | ||
| // taskDefinitionLabelValue represents the value of the option | ||
| // e.g. file path, arn, family. | ||
| taskDefinitionLabelType = "ecsLocalTaskDefType" | ||
| taskDefinitionLabelValue = "ecsLocalTaskDefVal" | ||
| ) | ||
|
|
||
| const ( | ||
| localTaskDefType = "localFile" | ||
| remoteTaskDefType = "remoteFile" | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also a little confused why these four constants are defined in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the idea is that eventually |
||
|
|
||
| const ( | ||
| ecsLocalDockerComposeFileName = "docker-compose.local.yml" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a different constant name for this: |
||
| ) | ||
|
|
||
| func Create(c *cli.Context) { | ||
| // 1. read in task def (from file or arn) | ||
| // 2. parse task def into go object | ||
| // 3. write to docker-compose.local.yml file | ||
| fmt.Println("foo") // placeholder | ||
| } | ||
|
|
||
| func validateOptions(c *cli.Context) error { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, not sure why this function lives in this file?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The flags that are being validated apply to all the sub-commands ( |
||
| if (c.String(flags.TaskDefinitionFileFlag) != "") && (c.String(flags.TaskDefinitionTaskFlag) != "") { | ||
| return fmt.Errorf("%s and %s can not be used together", | ||
| flags.TaskDefinitionTaskFlag, flags.TaskDefinitionFileFlag) | ||
| } | ||
| return nil | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.