Skip to content

Commit

Permalink
feat: add quickstart demo application (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-hm19 authored Jun 7, 2024
1 parent 7aa5c92 commit 56f70a6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
7 changes: 7 additions & 0 deletions example/quickstart/default/kcl.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]

[dependencies]
kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.2.0" }
service = { oci = "oci://ghcr.io/kusionstack/service", tag = "0.1.0" }
mysql = { oci = "oci://ghcr.io/kusionstack/mysql", tag = "0.2.0" }
network = { oci = "oci://ghcr.io/kusionstack/network", tag = "0.2.0" }
36 changes: 36 additions & 0 deletions example/quickstart/default/main.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# The configuration codes in perspective of developers.
import kam.v1.app_configuration as ac
import service
import service.container as c
import network as n
import mysql

# Please replace the ${APPLICATION_NAME} with the name of your application, and complete the
# 'AppConfiguration' instance with your own workload and accessories.
quickstart: ac.AppConfiguration {
workload: service.Service {
containers: {
quickstart: c.Container {
image: "kusionstack/kusion-quickstart:latest"
env: {
"DB_HOST": "$(KUSION_DB_HOST_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)"
"DB_USERNAME": "$(KUSION_DB_USERNAME_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)"
"DB_PASSWORD": "$(KUSION_DB_PASSWORD_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)"
}
}
}
}
accessories: {
"network": n.Network {
ports: [
n.Port {
port: 8080
}
]
}
"mysql": mysql.MySQL {
type: "local"
version: "8.0"
}
}
}
2 changes: 2 additions & 0 deletions example/quickstart/default/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The metadata information of the stack.
name: default
1 change: 1 addition & 0 deletions example/quickstart/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: quickstart

0 comments on commit 56f70a6

Please sign in to comment.