Skip to content

Commit 49aa7f4

Browse files
authored
Merge pull request #391 from oasisprotocol/kostko/feature/rofl-create-init-change
feat(cmd/rofl): Only create deployments in create not init
2 parents aa3dd09 + 6baeed4 commit 49aa7f4

7 files changed

Lines changed: 123 additions & 185 deletions

File tree

build/rofl/manifest.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type Manifest struct {
5555
Artifacts *ArtifactsConfig `yaml:"artifacts,omitempty" json:"artifacts,omitempty"`
5656

5757
// Deployments are the ROFL app deployments.
58-
Deployments map[string]*Deployment `yaml:"deployments" json:"deployments"`
58+
Deployments map[string]*Deployment `yaml:"deployments,omitempty" json:"deployments,omitempty"`
5959

6060
// Scripts are custom scripts that are executed by the build system at specific stages.
6161
Scripts map[string]string `yaml:"scripts,omitempty" json:"scripts,omitempty"`
@@ -150,9 +150,6 @@ func (m *Manifest) Validate() error {
150150
return fmt.Errorf("bad deployment '%s': %w", name, err)
151151
}
152152
}
153-
if _, ok := m.Deployments[DefaultDeploymentName]; !ok {
154-
return fmt.Errorf("must define at least the '%s' deployment", DefaultDeploymentName)
155-
}
156153

157154
return nil
158155
}

build/rofl/manifest_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ func TestManifestValidation(t *testing.T) {
5151
err = m.Validate()
5252
require.ErrorContains(err, "bad resources config: vCPU count must be at least 1")
5353

54-
// No default deployment.
54+
// Should be valid without deployments.
5555
m.Resources.CPUCount = 1
5656
err = m.Validate()
57-
require.ErrorContains(err, "must define at least the 'default' deployment")
57+
require.NoError(err, "must work without deployments")
5858

5959
// Missing network in deployment.
6060
m.Deployments = map[string]*Deployment{

0 commit comments

Comments
 (0)