Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
commit
779c48145c
2
.drone.yml
Normal file
2
.drone.yml
Normal file
@ -0,0 +1,2 @@
|
||||
kind: template
|
||||
load: cuddle-rust-cli-plan.yaml
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
target/
|
||||
.cuddle/
|
1028
Cargo.lock
generated
Normal file
1028
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
13
Cargo.toml
Normal file
13
Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[workspace]
|
||||
members = ["crates/*"]
|
||||
resolver = "2"
|
||||
|
||||
[workspace.dependencies]
|
||||
cuddle = { path = "crates/cuddle" }
|
||||
|
||||
anyhow = { version = "1" }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tracing = { version = "0.1", features = ["log"] }
|
||||
tracing-subscriber = { version = "0.3.18" }
|
||||
clap = { version = "4", features = ["derive", "env"] }
|
||||
dotenv = { version = "0.15" }
|
1
crates/cuddle/.gitignore
vendored
Normal file
1
crates/cuddle/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target
|
15
crates/cuddle/Cargo.toml
Normal file
15
crates/cuddle/Cargo.toml
Normal file
@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "cuddle"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
clap.workspace = true
|
||||
dotenv.workspace = true
|
||||
|
||||
serde = { version = "1.0.197", features = ["derive"] }
|
||||
nickel = "0.11.0"
|
7
crates/cuddle/src/main.rs
Normal file
7
crates/cuddle/src/main.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
dotenv::dotenv().ok();
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
Ok(())
|
||||
}
|
21
cuddle.yaml
Normal file
21
cuddle.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||
|
||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-cli-plan.git"
|
||||
|
||||
vars:
|
||||
service: "cuddle"
|
||||
registry: kasperhermansen
|
||||
|
||||
clusters:
|
||||
clank-prod:
|
||||
replicas: "3"
|
||||
namespace: prod
|
||||
|
||||
|
||||
deployment:
|
||||
registry: git@git.front.kjuulh.io:kjuulh/clank-clusters
|
||||
env:
|
||||
prod:
|
||||
clusters:
|
||||
- clank-prod
|
||||
|
39
examples/cuddle.ncl
Normal file
39
examples/cuddle.ncl
Normal file
@ -0,0 +1,39 @@
|
||||
let { Vars, GoPlan, .. } = import "cuddle/vars.ncl" in
|
||||
|
||||
let something = "something" in
|
||||
|
||||
{
|
||||
vars = {
|
||||
name = "some-service",
|
||||
owner = "git.front.kjuulh.io/kjuulh",
|
||||
|
||||
values = {
|
||||
something = {
|
||||
something = "something"
|
||||
},
|
||||
something_else = {
|
||||
something = {
|
||||
some = "something",
|
||||
something = "something"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
go_plan = {
|
||||
database = {
|
||||
enabled = true
|
||||
},
|
||||
rabbitmq = {
|
||||
enabled = true
|
||||
},
|
||||
clusters = {
|
||||
dev = {
|
||||
name = "something",
|
||||
env = {
|
||||
"some.thing" = something
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
} & Vars & GoPlan
|
1
examples/cuddle.yaml
Normal file
1
examples/cuddle.yaml
Normal file
@ -0,0 +1 @@
|
||||
|
3
renovate.json
Normal file
3
renovate.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||
}
|
54
shuttle_upstream-plan/cuddle/vars.ncl
Normal file
54
shuttle_upstream-plan/cuddle/vars.ncl
Normal file
@ -0,0 +1,54 @@
|
||||
{
|
||||
Var = fun label value =>
|
||||
if std.is_record value then
|
||||
value | {_: Var}
|
||||
else if std.is_string value then
|
||||
value | String
|
||||
else
|
||||
std.contract.blame_with_message "value was not a record or string" label,
|
||||
|
||||
Vars =
|
||||
{
|
||||
vars = {
|
||||
name
|
||||
| String,
|
||||
owner
|
||||
| String,
|
||||
values
|
||||
| {_ | Var}
|
||||
}
|
||||
},
|
||||
|
||||
Cluster = {
|
||||
name | String,
|
||||
env | {_: String} | optional
|
||||
},
|
||||
|
||||
Clusters = {_: Cluster},
|
||||
|
||||
DatabaseOffering = {
|
||||
database = {
|
||||
enabled
|
||||
| Bool
|
||||
| optional
|
||||
}
|
||||
},
|
||||
|
||||
QueueOffering = {
|
||||
rabbitmq = {
|
||||
enabled
|
||||
| Bool
|
||||
| optional
|
||||
}
|
||||
},
|
||||
|
||||
GoPlan = {
|
||||
go_plan = {
|
||||
clusters
|
||||
| Clusters
|
||||
}
|
||||
& DatabaseOffering
|
||||
& QueueOffering
|
||||
|
||||
}
|
||||
}
|
15
templates/docker-compose.yaml
Normal file
15
templates/docker-compose.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
version: "3"
|
||||
services:
|
||||
crdb:
|
||||
restart: 'always'
|
||||
image: 'cockroachdb/cockroach:v23.1.14'
|
||||
command: 'start-single-node --advertise-addr 0.0.0.0 --insecure'
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
|
||||
interval: '10s'
|
||||
timeout: '30s'
|
||||
retries: 5
|
||||
start_period: '20s'
|
||||
ports:
|
||||
- 8080:8080
|
||||
- '26257:26257'
|
Loading…
Reference in New Issue
Block a user