Skip to content

Commit 115c8df

Browse files
authored
config: Add top-level cloud configuration (#2204)
Add organization, project and hostname options for future remote execution support.
1 parent fd3ed9d commit 115c8df

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

internal/config/config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const (
5858
type Config struct {
5959
Version string `json:"version" yaml:"version"`
6060
Project Project `json:"project" yaml:"project"`
61+
Cloud Cloud `json:"cloud" yaml:"cloud"`
6162
SQL []SQL `json:"sql" yaml:"sql"`
6263
Gen Gen `json:"overrides,omitempty" yaml:"overrides"`
6364
Plugins []Plugin `json:"plugins" yaml:"plugins"`
@@ -67,6 +68,12 @@ type Project struct {
6768
ID string `json:"id" yaml:"id"`
6869
}
6970

71+
type Cloud struct {
72+
Organization string `json:"organization" yaml:"organization"`
73+
Project string `json:"project" yaml:"project"`
74+
Hostname string `json:"hostname" yaml:"hostname"`
75+
}
76+
7077
type Plugin struct {
7178
Name string `json:"name" yaml:"name"`
7279
Process *struct {

internal/config/v_one.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
type V1GenerateSettings struct {
1212
Version string `json:"version" yaml:"version"`
13+
Cloud Cloud `json:"cloud" yaml:"cloud"`
1314
Project Project `json:"project" yaml:"project"`
1415
Packages []v1PackageSettings `json:"packages" yaml:"packages"`
1516
Overrides []Override `json:"overrides,omitempty" yaml:"overrides,omitempty"`
@@ -124,6 +125,7 @@ func (c *V1GenerateSettings) Translate() Config {
124125
conf := Config{
125126
Version: c.Version,
126127
Project: c.Project,
128+
Cloud: c.Cloud,
127129
}
128130

129131
for _, pkg := range c.Packages {

0 commit comments

Comments
 (0)