Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

artifact definition in config file is now a protobuf. #92

Merged
merged 1 commit into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
artifact definition in config file is now a protobuf.
Previously it was a flat yaml string but this is harder to edit correctly.
  • Loading branch information
scudette committed Sep 30, 2019
commit f269b77367b313bd89b67b774b15805d77a34b07
41 changes: 39 additions & 2 deletions artifacts/assets/ab0x.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion bin/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ func load_config_artifacts(config_obj *config_proto.Config) {
}
repository := getRepository(config_obj)
for _, definition := range config_obj.Autoexec.ArtifactDefinitions {
_, err := repository.LoadYaml(definition, true /* validate */)
serialized, err := yaml.Marshal(definition)
kingpin.FatalIfError(err, "Unable to parse config artifact")

_, err = repository.LoadYaml(string(serialized), true /* validate */)
kingpin.FatalIfError(err, "Unable to parse config artifact")
}
}
Expand Down
11 changes: 8 additions & 3 deletions bin/repack.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ func validate_config(config_data []byte) error {
if test_config.Autoexec != nil {
repository := artifacts.NewRepository()

for _, def := range test_config.Autoexec.ArtifactDefinitions {
_, err := repository.LoadYaml(def, true /* validate */)
for _, definition := range test_config.Autoexec.ArtifactDefinitions {
serialized, err := yaml.Marshal(definition)
if err != nil {
return err
}

_, err = repository.LoadYaml(string(serialized), true /* validate */)
if err != nil {
return errors.New(
fmt.Sprintf("While parsing artifact: %s\n%s",
err, def))
err, string(serialized)))
}
}
}
Expand Down
Loading