diff --git a/internal/projectinit/projectinit_test.go b/internal/projectinit/projectinit_test.go index 2b45dd8..fc40c82 100644 --- a/internal/projectinit/projectinit_test.go +++ b/internal/projectinit/projectinit_test.go @@ -3,6 +3,7 @@ package projectinit import ( "os" "path/filepath" + "strings" "testing" "github.com/stretchr/testify/assert" @@ -38,7 +39,15 @@ func TestRunCreatesScaffold(t *testing.T) { assert.Contains(t, ignore, "volcano.env") readme := readProjectFile(t, dir, filepath.Join("volcano", "README.md")) - assert.Contains(t, readme, "If this project includes volcano/volcano-config.yaml") + assert.Contains(t, readme, "If this project includes volcano/functions:\n\n volcano functions deploy --all") + assert.Contains(t, readme, "If this project includes volcano/functions:\n\n volcano cloud functions deploy --all") + assert.Contains(t, readme, "If this project includes volcano/volcano-config.yaml:\n\n volcano config deploy") + assert.Contains(t, readme, "If this project includes volcano/volcano-config.yaml:\n\n volcano cloud config deploy") + assert.Equal(t, 1, strings.Count(readme, "volcano functions deploy --all")) + assert.Equal(t, 1, strings.Count(readme, "volcano cloud functions deploy --all")) + assert.Equal(t, 1, strings.Count(readme, "volcano config deploy")) + assert.Equal(t, 1, strings.Count(readme, "volcano cloud config deploy")) + assert.NotContains(t, readme, "configuration, functions, migrations") } func TestRunRejectsInvalidStarterNames(t *testing.T) { diff --git a/internal/projectinit/starters/base/volcano/README.md b/internal/projectinit/starters/base/volcano/README.md index f9a6cd4..ccf57c4 100644 --- a/internal/projectinit/starters/base/volcano/README.md +++ b/internal/projectinit/starters/base/volcano/README.md @@ -1,14 +1,17 @@ # Volcano -This directory contains Volcano configuration, functions, migrations, and local variables. +This directory contains Volcano migrations and local variables. Local development: volcano start volcano variables deploy - volcano functions deploy --all volcano migrations deploy --all -d app +If this project includes volcano/functions: + + volcano functions deploy --all + If this project includes volcano/volcano-config.yaml: volcano config deploy @@ -18,6 +21,9 @@ Cloud deployment: volcano login volcano use volcano cloud variables deploy + +If this project includes volcano/functions: + volcano cloud functions deploy --all If this project includes volcano/volcano-config.yaml: