(srcDir string)
| 77 | } |
| 78 | |
| 79 | func (s *SpreadCli) fileDeploy(srcDir string) (*deploy.Deployment, error) { |
| 80 | input, err := dir.NewFileInput(srcDir) |
| 81 | if err != nil { |
| 82 | return nil, inputError(srcDir, err) |
| 83 | } |
| 84 | |
| 85 | e, err := input.Build() |
| 86 | if err != nil { |
| 87 | return nil, inputError(srcDir, err) |
| 88 | } |
| 89 | |
| 90 | dep, err := e.Deployment() |
| 91 | |
| 92 | // TODO: This can be removed once application (#56) is implemented |
| 93 | if err == entity.ErrMissingContainer { |
| 94 | // check if has pod; if not deploy objects |
| 95 | pods, err := input.Entities(entity.EntityPod) |
| 96 | if err != nil && len(pods) != 0 { |
| 97 | return nil, fmt.Errorf("Failed to deploy: %v", err) |
| 98 | } |
| 99 | |
| 100 | dep, err = objectOnlyDeploy(input) |
| 101 | if err != nil { |
| 102 | return nil, fmt.Errorf("Failed to deploy: %v", err) |
| 103 | } |
| 104 | |
| 105 | } else if err != nil { |
| 106 | return nil, inputError(srcDir, err) |
| 107 | } |
| 108 | return dep, nil |
| 109 | } |
| 110 | |
| 111 | func (s *SpreadCli) globalDeploy(ref string) (*deploy.Deployment, error) { |
| 112 | // check if reference is local file |
no test coverage detected