| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "io/ioutil" | 8 "io/ioutil" |
| 9 "os" | 9 "os" |
| 10 "path/filepath" | 10 "path/filepath" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // Referenced handler paths. | 224 // Referenced handler paths. |
| 225 for i, p := range aem.HandlerPath { | 225 for i, p := range aem.HandlerPath { |
| 226 var msg deploy.AppEngineModule_HandlerSet | 226 var msg deploy.AppEngineModule_HandlerSet |
| 227 if err := unmarshalTextProtobuf(comp.pathTo(p), &msg); e
rr != nil { | 227 if err := unmarshalTextProtobuf(comp.pathTo(p), &msg); e
rr != nil { |
| 228 return errors.Annotate(err).Reason("failed to lo
ad HandlerSet #%(index)d for %(component)q"). | 228 return errors.Annotate(err).Reason("failed to lo
ad HandlerSet #%(index)d for %(component)q"). |
| 229 D("index", i).D("component", comp).Err() | 229 D("index", i).D("component", comp).Err() |
| 230 } | 230 } |
| 231 module.Handlers.Handler = append(module.Handlers.Handler
, msg.Handler...) | 231 module.Handlers.Handler = append(module.Handlers.Handler
, msg.Handler...) |
| 232 } | 232 } |
| 233 | 233 |
| 234 // If the module specifies a direct "index.yaml" path, load inde
x entries |
| 235 // from there and translate them to resources. |
| 236 if p := module.IndexYamlPath; p != "" { |
| 237 path := module.comp.pathTo(p) |
| 238 res, err := loadIndexYAMLResource(path) |
| 239 if err != nil { |
| 240 return errors.Annotate(err).Reason("failed to lo
ad 'index.yaml' from [%(path)s]"). |
| 241 D("path", path).Err() |
| 242 } |
| 243 dep.cloudProject.appendResources(res, &module) |
| 244 } |
| 245 |
| 234 // Append GAE Resources. | 246 // Append GAE Resources. |
| 235 if r := module.Resources; r != nil { | 247 if r := module.Resources; r != nil { |
| 236 dep.cloudProject.appendResources(r, &module) | 248 dep.cloudProject.appendResources(r, &module) |
| 237 } | 249 } |
| 238 | 250 |
| 239 for i, p := range module.ResourcePath { | 251 for i, p := range module.ResourcePath { |
| 240 if err := comp.dep.substituteParams(&p); err != nil { | 252 if err := comp.dep.substituteParams(&p); err != nil { |
| 241 return errors.Annotate(err).Reason("failed to su
bstitute parameters for resource path"). | 253 return errors.Annotate(err).Reason("failed to su
bstitute parameters for resource path"). |
| 242 D("path", p).Err() | 254 D("path", p).Err() |
| 243 } | 255 } |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 return "", errors.Reason("could not find %(filename)q st
arting from %(dir)q"). | 986 return "", errors.Reason("could not find %(filename)q st
arting from %(dir)q"). |
| 975 D("filename", filename).D("dir", dir).Err() | 987 D("filename", filename).D("dir", dir).Err() |
| 976 } | 988 } |
| 977 } | 989 } |
| 978 } | 990 } |
| 979 | 991 |
| 980 type componentRegistrar interface { | 992 type componentRegistrar interface { |
| 981 addGAEModule(*layoutDeploymentGAEModule) | 993 addGAEModule(*layoutDeploymentGAEModule) |
| 982 addGKEPod(*layoutDeploymentGKEPodBinding) | 994 addGKEPod(*layoutDeploymentGKEPodBinding) |
| 983 } | 995 } |
| OLD | NEW |