Skip to content

Commit

Permalink
feat: update wordpress samples (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-hm19 authored Jan 15, 2024
1 parent f2abe9b commit 6ece7a9
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "wordpress"
name = "wordpress-cloud-rds"
version = "0.1.0"

[dependencies]
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.2" }

[profile]
entries = ["main.k","platform.k"]
entries = ["main.k"]

38 changes: 38 additions & 0 deletions example/wordpress-cloud-rds/prod/main.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import catalog.models.schema.v1 as ac
import catalog.models.schema.v1.workload as wl
import catalog.models.schema.v1.workload.container as c
import catalog.models.schema.v1.workload.network as n
import catalog.models.schema.v1.accessories.mysql

# main.k declares customized configurations for prod stacks.
wordpress: ac.AppConfiguration {
workload: wl.Service {
containers: {
wordpress: c.Container {
image: "wordpress:6.3"
env: {
"WORDPRESS_DB_HOST": "$(KUSION_DB_HOST_WORDPRESS_MYSQL)"
"WORDPRESS_DB_USER": "$(KUSION_DB_USERNAME_WORDPRESS_MYSQL)"
"WORDPRESS_DB_PASSWORD": "$(KUSION_DB_PASSWORD_WORDPRESS_MYSQL)"
"WORDPRESS_DB_NAME": "mysql"
}
resources: {
"cpu": "500m"
"memory": "512Mi"
}
}
}
replicas: 1
ports: [
n.Port {
port: 80
}
]
}
database: {
wordpress: mysql.MySQL {
type: "cloud"
version: "8.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# The stack basic info
name: dev
name: prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The project basic info
name: wordpress
name: wordpress-cloud-rds
generator:
type: AppConfiguration
9 changes: 9 additions & 0 deletions example/wordpress-local-db/prod/kcl.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "wordpress-local-db"
version = "0.1.0"

[dependencies]
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.2" }
[profile]
entries = ["main.k"]

34 changes: 34 additions & 0 deletions example/wordpress-local-db/prod/main.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import catalog.models.schema.v1 as ac
import catalog.models.schema.v1.workload as wl
import catalog.models.schema.v1.workload.container as c
import catalog.models.schema.v1.workload.network as n
import catalog.models.schema.v1.accessories.mysql

# main.k declares customized configurations for prod stack.
wordpress: ac.AppConfiguration {
workload: wl.Service {
containers: {
wordpress: c.Container {
image: "wordpress:6.3"
env: {
"WORDPRESS_DB_HOST": "$(KUSION_DB_HOST_WORDPRESS_MYSQL)"
"WORDPRESS_DB_USER": "$(KUSION_DB_USERNAME_WORDPRESS_MYSQL)"
"WORDPRESS_DB_PASSWORD": "$(KUSION_DB_PASSWORD_WORDPRESS_MYSQL)"
"WORDPRESS_DB_NAME": "mysql"
}
}
}
replicas: 1
ports: [
n.Port {
port: 80
}
]
}
database: {
wordpress: mysql.MySQL {
type: "local"
version: "8.0"
}
}
}
2 changes: 2 additions & 0 deletions example/wordpress-local-db/prod/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The stack basic info
name: prod
4 changes: 4 additions & 0 deletions example/wordpress-local-db/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# The project basic info
name: wordpress-local-db
generator:
type: AppConfiguration
43 changes: 0 additions & 43 deletions example/wordpress/dev/main.k

This file was deleted.

14 changes: 0 additions & 14 deletions example/wordpress/dev/platform.k

This file was deleted.

0 comments on commit 6ece7a9

Please sign in to comment.