-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate the crd as yaml using a build.rs
- Loading branch information
Showing
14 changed files
with
5,065 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.git | ||
target | ||
*/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
FROM rust:1.58-buster as builder | ||
ADD . /app | ||
WORKDIR /app | ||
RUN cargo build --release | ||
RUN cd /app/docbot-controller && cargo build --release | ||
|
||
FROM debian:buster-slim | ||
RUN apt-get update \ | ||
&& apt-get install -y libssl1.1 ca-certificates\ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY --from=builder /app/target/release/docbot /srv/docbot/docbot | ||
COPY --from=builder /app/docbot-controller/target/release/docbot-controller /srv/docbot/docbot-controller | ||
WORKDIR /srv/docbot | ||
ENTRYPOINT ["/srv/docbot/docbot"] | ||
ENTRYPOINT ["/srv/docbot/docbot-controller"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[package] | ||
name = "docbot-controller" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
tokio = { version = "1.15.0", features = ["full"] } | ||
futures = "0.3.19" | ||
serde = "1" | ||
serde_json = "1.0" | ||
serde_yaml = "0.8" | ||
schemars = "0.8" | ||
docbot-crd = { path = "../docbot-crd" } | ||
|
||
k8s-openapi = { version = "0.13", default-features = false, features = ["v1_17", "schemars"] } # Kube-rs depends on k8s-openapi | ||
kube = { version = "0.65", default-features = true, features = ["derive"] } # Library for talking to Kubernetes API | ||
kube-runtime = "0.65" | ||
|
||
[build-dependencies] | ||
tokio = { version = "1.15.0", features = ["full"] } | ||
futures = "0.3.19" | ||
serde = "1" | ||
serde_json = "1.0" | ||
serde_yaml = "0.8" | ||
schemars = "0.8" | ||
docbot-crd = { path = "../docbot-crd" } | ||
|
||
k8s-openapi = { version = "0.13", default-features = false, features = ["v1_17", "schemars"] } # Kube-rs depends on k8s-openapi | ||
kube = { version = "0.65", default-features = true, features = ["derive"] } # Library for talking to Kubernetes API | ||
kube-runtime = "0.65" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use docbot_crd::DeploymentHook; | ||
use kube::CustomResourceExt; | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
let crate_dir = std::env::var_os("CARGO_MANIFEST_DIR").unwrap(); | ||
let schema = serde_yaml::to_string(&DeploymentHook::crd()).unwrap(); | ||
let crd_schema_path = Path::new(&crate_dir) | ||
.join("..") | ||
.join("deploymenthooks.apps.mx.com.yaml"); | ||
let mut f = File::create(&crd_schema_path).unwrap(); | ||
f.write_all(schema.as_bytes()).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Oops, something went wrong.