From 00bc0e0363f1d90c27b35349e2a2905d3e8c2600 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 30 Mar 2024 00:27:14 +0100 Subject: [PATCH] feat: add basic Signed-off-by: kjuulh --- .drone.yml | 124 + .gitignore | 2 + Cargo.lock | 2276 +++++++++++++++++ Cargo.toml | 14 + README.md | 7 + crates/drone-templater/.gitignore | 1 + crates/drone-templater/Cargo.toml | 18 + .../crdb/20240201211013_initial.sql | 1 + crates/drone-templater/src/main.rs | 29 + cuddle.yaml | 21 + renovate.json | 3 + templates/docker-compose.yaml | 15 + 12 files changed, 2511 insertions(+) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 README.md create mode 100644 crates/drone-templater/.gitignore create mode 100644 crates/drone-templater/Cargo.toml create mode 100644 crates/drone-templater/migrations/crdb/20240201211013_initial.sql create mode 100644 crates/drone-templater/src/main.rs create mode 100644 cuddle.yaml create mode 100644 renovate.json create mode 100644 templates/docker-compose.yaml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..7e3ba79 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,124 @@ +kind: pipeline +name: default +type: docker + +steps: + - name: load_secret + image: debian:buster-slim + volumes: + - name: ssh + path: /root/.ssh/ + environment: + SSH_KEY: + from_secret: gitea_id_ed25519 + commands: + - mkdir -p $HOME/.ssh/ + - echo "$SSH_KEY" | base64 -d > $HOME/.ssh/id_ed25519 + - chmod -R 600 ~/.ssh + - | + cat >$HOME/.ssh/config <, +} + +#[derive(Subcommand)] +enum Commands { + Hello {}, +} + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + dotenv::dotenv().ok(); + tracing_subscriber::fmt::init(); + + let cli = Command::parse(); + tracing::debug!("Starting cli"); + + if let Some(Commands::Hello { }) = cli.command { + println!("Hello!") + } + + Ok(()) +} diff --git a/cuddle.yaml b/cuddle.yaml new file mode 100644 index 0000000..c1fda8d --- /dev/null +++ b/cuddle.yaml @@ -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: "drone-templater" + registry: kasperhermansen + + clusters: + clank-prod: + replicas: "3" + namespace: prod + + +deployment: + registry: git@git.front.kjuulh.io:kjuulh/clank-clusters + env: + prod: + clusters: + - clank-prod + diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..7190a60 --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json" +} diff --git a/templates/docker-compose.yaml b/templates/docker-compose.yaml new file mode 100644 index 0000000..8fae72a --- /dev/null +++ b/templates/docker-compose.yaml @@ -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'