-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCargo.toml
83 lines (75 loc) · 2.7 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[workspace]
resolver = "1"
members = [
"agent",
"operator",
"common",
]
default-members = [
"agent",
"operator",
]
[workspace.dependencies]
k8s-openapi = { version = "0.23.0", features = ["latest"], default-features = false }
tracing = "0.1.37"
serde = { version = "1.0.214", features = ["derive"] }
serde_json = "1.0.105"
serde_yaml = "0.9.25"
tokio = { version = "1.41.0", features = ["macros", "rt-multi-thread"] }
chrono = { version = "0.4.38", features = ["serde"] }
schemars = { version = "0.8.12", features = ["chrono"] }
actix-web = "4.9.0"
base64 = "0.22.1"
[workspace.dependencies.kube]
features = ["runtime", "client", "derive" ]
version = "0.96.0"
[workspace.package]
version = "0.3.3"
authors = ["Sébastien Huss <sebastien.huss@gmail.com>"]
edition = "2021"
license = "BSD-3-Clause"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[package]
name = "vynil"
publish = false
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
[profile.release]
strip = true
# use "cargo install cargo-commander", then "cargo cmd generate"
[package.metadata.commands]
generate_crd = { cmd=[
"cargo run --bin agent -- crdgen > box/vynil/crds/crd.yaml",
"cp box/vynil/crds/crd.yaml deploy/crd/crd.yaml",
]}
generate = { cmd=[
"cargo cmd generate_crd",
"awk 'BEGIN{p=1}/profile.release/{p=0}p==1&&!/\"operator\",/'<Cargo.toml>agent/parent.toml",
"awk 'BEGIN{p=1}/profile.release/{p=0}p==1&&!/\"agent\",/'<Cargo.toml>operator/parent.toml",
]}
crd = { cmd=[
"cargo cmd generate_crd",
"kubectl apply -f box/vynil/crds/crd.yaml"
]}
fmt = { cmd=[
"cargo +nightly fmt"
]}
precommit = { cmd=[
"cargo update",
"cargo clippy --fix --allow-dirty --allow-staged",
"cargo cmd generate",
"cargo +nightly fmt"
]}
agent = { cmd=[
"podman build . -f agent/Dockerfile -t docker.io/sebt3/vynil-agent:$(cargo run --bin agent -- version) && podman push docker.io/sebt3/vynil-agent:$(cargo run --bin agent -- version)",
]}
operator = { cmd=[
"podman build . -f operator/Dockerfile -t docker.io/sebt3/vynil-operator:$(cargo run --bin agent -- version) && podman push docker.io/sebt3/vynil-operator:$(cargo run --bin agent -- version)",
]}
box = { cmd=[
"cargo cmd generate_crd",
"cargo run --bin agent -- package update --source ./box/vynil/",
"cargo run --bin agent -- package build -o ./box/vynil/ --tag $(cargo run --bin agent -- version) -r docker.io -n sebt3/vynil -u $(jq -r '.auths[\"docker.io\"].auth' </run/user/$(id -u)/containers/auth.json |base64 -d|awk -F: '{print $1}') -p $(jq -r '.auths[\"docker.io\"].auth' </run/user/$(id -u)/containers/auth.json |base64 -d|awk -F: '{print $2}')",
]}