netlify: Europa port
- Fix netlify.#Deploy (there's still FIXMEs) - Externalize the `deploy.sh` script - Add tests - Misc engine fixes for more explicit error messages Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -77,6 +77,10 @@ func (c *fsContext) FromValue(v *compiler.Value) (*FS, error) {
|
||||
c.l.RLock()
|
||||
defer c.l.RUnlock()
|
||||
|
||||
if !v.LookupPath(fsIDPath).IsConcrete() {
|
||||
return nil, fmt.Errorf("invalid FS at path %q: FS is not set", v.Path())
|
||||
}
|
||||
|
||||
// This is #Scratch, so we'll return an empty FS
|
||||
if v.LookupPath(fsIDPath).Kind() == cue.NullKind {
|
||||
return &FS{}, nil
|
||||
|
@@ -64,9 +64,13 @@ func (c *secretContext) FromValue(v *compiler.Value) (*Secret, error) {
|
||||
c.l.RLock()
|
||||
defer c.l.RUnlock()
|
||||
|
||||
if !v.LookupPath(secretIDPath).IsConcrete() {
|
||||
return nil, fmt.Errorf("invalid secret at path %q: secret is not set", v.Path())
|
||||
}
|
||||
|
||||
id, err := v.LookupPath(secretIDPath).String()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid secret %q: %w", v.Path(), err)
|
||||
return nil, fmt.Errorf("invalid secret at path %q: %w", v.Path(), err)
|
||||
}
|
||||
|
||||
secret, ok := c.store[id]
|
||||
|
@@ -71,9 +71,13 @@ func (c *serviceContext) FromValue(v *compiler.Value) (*Service, error) {
|
||||
c.l.RLock()
|
||||
defer c.l.RUnlock()
|
||||
|
||||
if !v.LookupPath(serviceIDPath).IsConcrete() {
|
||||
return nil, fmt.Errorf("invalid service at path %q: service is not set", v.Path())
|
||||
}
|
||||
|
||||
id, err := v.LookupPath(serviceIDPath).String()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid service %q: %w", v.Path(), err)
|
||||
return nil, fmt.Errorf("invalid service at path %q: %w", v.Path(), err)
|
||||
}
|
||||
|
||||
s, ok := c.store[id]
|
||||
|
Reference in New Issue
Block a user