Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update the init and stack create scaffolding templates #1149

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading