Skip to content

Commit

Permalink
config: Add top-level cloud configuration (#2204)
Browse files Browse the repository at this point in the history
Add organization, project and hostname options for future remote
execution support.
  • Loading branch information
kyleconroy committed Apr 13, 2023
1 parent fd3ed9d commit 115c8df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/config/config.go
Expand Up @@ -58,6 +58,7 @@ const (
type Config struct {
Version string `json:"version" yaml:"version"`
Project Project `json:"project" yaml:"project"`
Cloud Cloud `json:"cloud" yaml:"cloud"`
SQL []SQL `json:"sql" yaml:"sql"`
Gen Gen `json:"overrides,omitempty" yaml:"overrides"`
Plugins []Plugin `json:"plugins" yaml:"plugins"`
Expand All @@ -67,6 +68,12 @@ type Project struct {
ID string `json:"id" yaml:"id"`
}

type Cloud struct {
Organization string `json:"organization" yaml:"organization"`
Project string `json:"project" yaml:"project"`
Hostname string `json:"hostname" yaml:"hostname"`
}

type Plugin struct {
Name string `json:"name" yaml:"name"`
Process *struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/config/v_one.go
Expand Up @@ -10,6 +10,7 @@ import (

type V1GenerateSettings struct {
Version string `json:"version" yaml:"version"`
Cloud Cloud `json:"cloud" yaml:"cloud"`
Project Project `json:"project" yaml:"project"`
Packages []v1PackageSettings `json:"packages" yaml:"packages"`
Overrides []Override `json:"overrides,omitempty" yaml:"overrides,omitempty"`
Expand Down Expand Up @@ -124,6 +125,7 @@ func (c *V1GenerateSettings) Translate() Config {
conf := Config{
Version: c.Version,
Project: c.Project,
Cloud: c.Cloud,
}

for _, pkg := range c.Packages {
Expand Down

0 comments on commit 115c8df

Please sign in to comment.