Skip to content

Commit

Permalink
feat: update the init and stack create scaffolding templates (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-hm19 committed Jun 6, 2024
1 parent 1728745 commit db5886a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions pkg/cmd/stack/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ name: %s`
KCLModFile = "kcl.mod"
KCLModFileTemplate = `# Please add the modules you need in 'dependencies'.
[dependencies]
kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.1.0" }`
kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.2.0" }
service = {oci = "oci://ghcr.io/kusionstack/service", tag = "0.1.0" }`

MainKCLFile = "main.k"
MainKCLFileTemplate = `# The configuration codes in perspective of developers.
import kam.v1.app_configuration as ac
import service as wl
import service
import service.container as c
# Please replace the ${APPLICATION_NAME} with the name of your application, and complete the
# 'AppConfiguration' instance with your own workload and accessories.
${APPLICATION_NAME}: ac.AppConfiguration {
workload: wl.Service {
workload: service.Service {
containers: {
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/scaffold/quickstart/default/kcl.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[dependencies]
kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.1.0" }
network = { oci = "oci://ghcr.io/kusionstack/network", tag = "0.1.0" }
kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.2.0" }
service = {oci = "oci://ghcr.io/kusionstack/service", tag = "0.1.0" }
network = { oci = "oci://ghcr.io/kusionstack/network", tag = "0.2.0" }
6 changes: 3 additions & 3 deletions pkg/scaffold/quickstart/default/main.k
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import kam.v1.app_configuration as ac
import kam.v1.workload as wl
import kam.v1.workload.container as c
import service
import service.container as c
import network as n

# main.k declares the customized configuration codes for default stack.
quickstart: ac.AppConfiguration {
workload: wl.Service {
workload: service.Service {
containers: {
quickstart: c.Container {
image: "kusionstack/kusion-quickstart:latest"
Expand Down

0 comments on commit db5886a

Please sign in to comment.