MCPcopy
hub / github.com/redspread/spread / fileDeploy

Method fileDeploy

cli/deploy.go:79–109  ·  view source on GitHub ↗
(srcDir string)

Source from the content-addressed store, hash-verified

77}
78
79func (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
111func (s *SpreadCli) globalDeploy(ref string) (*deploy.Deployment, error) {
112 // check if reference is local file

Callers 1

globalDeployMethod · 0.95

Calls 5

BuildMethod · 0.95
inputErrorFunction · 0.85
objectOnlyDeployFunction · 0.85
EntitiesMethod · 0.80
DeploymentMethod · 0.65

Tested by

no test coverage detected