fix issue not converting legacy pipeline
This commit is contained in:
parent
6bc5b01366
commit
f463a67283
1 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/drone/drone-yaml/yaml/converter"
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/store/shared/db"
|
"github.com/drone/drone/store/shared/db"
|
||||||
|
|
||||||
|
@ -288,6 +289,15 @@ func (m *Manager) Details(ctx context.Context, id int64) (*Context, error) {
|
||||||
logger.Warnln("manager: cannot find configuration")
|
logger.Warnln("manager: cannot find configuration")
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this code is temporarily in place to detect and convert
|
||||||
|
// the legacy yaml configuration file to the new format.
|
||||||
|
config.Data, _ = converter.ConvertString(config.Data, converter.Metadata{
|
||||||
|
Filename: repo.Config,
|
||||||
|
URL: repo.Link,
|
||||||
|
Ref: build.Ref,
|
||||||
|
})
|
||||||
|
|
||||||
config, err = m.Converter.Convert(noContext, &core.ConvertArgs{
|
config, err = m.Converter.Convert(noContext, &core.ConvertArgs{
|
||||||
Build: build,
|
Build: build,
|
||||||
Config: config,
|
Config: config,
|
||||||
|
|
Loading…
Reference in a new issue