Compare commits
20 Commits
4c3c67c84d
...
main
Author | SHA1 | Date | |
---|---|---|---|
34a2d46254
|
|||
370c73f9b0
|
|||
277c09d490 | |||
5f522e314b | |||
e1f1d2429e | |||
24722e1550 | |||
b21a5d8647 | |||
730ae66c2b | |||
6f0f60286d | |||
87e3256660 | |||
1c6198b97a | |||
f3aef000ef | |||
b6b608ca1f
|
|||
cce311cfa3
|
|||
d6cc3ae5c5
|
|||
9a9734b2d7
|
|||
2712707da8
|
|||
0c6ba3d630
|
|||
227bbcef8e
|
|||
ac3c5d3672
|
@@ -33,7 +33,7 @@ steps:
|
||||
- chmod -R 600 ~/.ssh
|
||||
- |
|
||||
cat >$HOME/.ssh/config <<EOL
|
||||
Host git.front.kjuulh.io
|
||||
Host git.kjuulh.io
|
||||
IdentityFile $HOME/.ssh/id_ed25519
|
||||
IdentitiesOnly yes
|
||||
UserKnownHostsFile=/dev/null
|
||||
|
2047
Cargo.lock
generated
2047
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -4,11 +4,12 @@ resolver = "2"
|
||||
|
||||
[workspace.dependencies]
|
||||
|
||||
anyhow = { version = "1.0.86" }
|
||||
anyhow = { version = "1" }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tracing = { version = "0.1", features = ["log"] }
|
||||
tracing-subscriber = { version = "0.3.18" }
|
||||
tracing-subscriber = { version = "0.3" }
|
||||
clap = { version = "4.5.4", features = ["derive", "env"] }
|
||||
dotenv = { version = "0.15.0" }
|
||||
dotenv = { version = "0.15" }
|
||||
dagger-sdk = "0.18.3"
|
||||
|
||||
cuddle-clusters = { git = "https://git.front.kjuulh.io/kjuulh/cuddle-clusters", branch = "main" } #tag = "v0.1.1" }
|
||||
cuddle-clusters = { git = "https://git.kjuulh.io/kjuulh/cuddle-clusters", branch = "main" } #tag = "v0.1.1" }
|
||||
|
@@ -7,10 +7,10 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
tokio.workspace = true
|
||||
dagger-sdk.workspace = true
|
||||
|
||||
dagger-sdk = "0.13.7"
|
||||
eyre = { version = "0.6.12" }
|
||||
|
||||
dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
dagger-rust = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
cuddle-ci = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
dagger-components = { git = "https://git.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
dagger-rust = { git = "https://git.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
cuddle-ci = { git = "https://git.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
|
@@ -5,15 +5,14 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
tokio.workspace = true
|
||||
|
||||
dagger-sdk = "0.13.7"
|
||||
eyre = { version = "0.6.12" }
|
||||
|
||||
dagger-sdk.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
dagger-rust = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
cuddle-ci = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
eyre = { version = "0.6" }
|
||||
async-trait = "0.1"
|
||||
|
||||
dagger-components = { git = "https://git.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
dagger-rust = { git = "https://git.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
cuddle-ci = { git = "https://git.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
cuddle-clusters.workspace = true
|
||||
async-trait = "0.1.80"
|
||||
|
@@ -14,6 +14,7 @@ use cuddle_clusters::catalog::cluster_vars::ClusterVars;
|
||||
use cuddle_clusters::catalog::crdb_database::CockroachDB;
|
||||
use cuddle_clusters::catalog::cuddle_vars::CuddleVars;
|
||||
use cuddle_clusters::catalog::ingress::Ingress;
|
||||
use cuddle_clusters::catalog::postgres_database::PostgresDatabase;
|
||||
use cuddle_clusters::catalog::vault_secret::VaultSecret;
|
||||
use cuddle_clusters::releaser::Releaser;
|
||||
use cuddle_clusters::IntoComponent;
|
||||
@@ -37,89 +38,18 @@ async fn main() -> eyre::Result<()> {
|
||||
.with_mold("2.3.3")
|
||||
.to_owned();
|
||||
|
||||
let render = &RustServiceRender {
|
||||
service: cuddle_file.vars.service.clone(),
|
||||
//registry: "http://127.0.0.1:7900".into(),
|
||||
//registry: "http://10.0.11.19:7900".into(),
|
||||
registry: "https://releaser.i.kjuulh.io:443".into(),
|
||||
};
|
||||
let deployment = &CuddleReleaser::new(client.clone()).await?;
|
||||
|
||||
let mut ci = CuddleCI::default();
|
||||
|
||||
ci.with_pull_request(service)
|
||||
.with_pull_request(render)
|
||||
//.with_pull_request(deployment.clone())
|
||||
.with_main(service)
|
||||
.with_main(render)
|
||||
.with_main(deployment);
|
||||
|
||||
if cuddle_file.please.is_some() {
|
||||
ci.with_main(&CuddlePlease::new(client.clone()));
|
||||
}
|
||||
|
||||
let name = cuddle_file.vars.service.clone();
|
||||
let system_time = SystemTime::now().duration_since(UNIX_EPOCH)?;
|
||||
let build_notifications = client
|
||||
.container()
|
||||
.from("docker.io/kasperhermansen/build-notifications:main-1731768496")
|
||||
.with_env_variable("TIME", system_time.as_secs().to_string())
|
||||
.with_env_variable(
|
||||
"SERVICE_HOST",
|
||||
"https://build-notifications.prod.internal.kjuulh.app",
|
||||
)
|
||||
.with_env_variable(
|
||||
"SERVICE_GRPC_HOST",
|
||||
"https://grpc.build-notifications.prod.internal.kjuulh.app",
|
||||
);
|
||||
|
||||
if let Err(e) = build_notifications
|
||||
.with_exec(vec![
|
||||
"build-notifications",
|
||||
"build-started",
|
||||
"--project-name",
|
||||
&name,
|
||||
])
|
||||
.sync()
|
||||
.await
|
||||
{
|
||||
tracing::warn!("failed to send start notification: {}", e.to_string())
|
||||
}
|
||||
|
||||
match ci.execute(std::env::args()).await {
|
||||
Ok(()) => {
|
||||
if let Err(e) = build_notifications
|
||||
.with_exec(vec![
|
||||
"build-notifications",
|
||||
"build-success",
|
||||
"--project-name",
|
||||
&name,
|
||||
])
|
||||
.sync()
|
||||
.await
|
||||
{
|
||||
tracing::warn!("failed to send success notification: {}", e.to_string())
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
if let Err(e) = build_notifications
|
||||
.with_exec(vec![
|
||||
"build-notifications",
|
||||
"build-failure",
|
||||
"--project-name",
|
||||
&name,
|
||||
"--error",
|
||||
&e.to_string(),
|
||||
])
|
||||
.sync()
|
||||
.await
|
||||
{
|
||||
tracing::warn!("failed to send failure notification: {}", e.to_string())
|
||||
}
|
||||
|
||||
return Err(e);
|
||||
}
|
||||
}
|
||||
ci.execute(std::env::args()).await?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
@@ -154,6 +84,10 @@ impl RustServiceRender {
|
||||
.await
|
||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||
.into_component(),
|
||||
PostgresDatabase::new(&std::env::current_dir()?)
|
||||
.await
|
||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||
.into_component(),
|
||||
Ingress::new(&std::env::current_dir()?)
|
||||
.await
|
||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||
# yaml-language-server: $schema=https://git.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||
|
||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git"
|
||||
base: "git@git.kjuulh.io:kjuulh/cuddle-base.git"
|
||||
|
||||
vars:
|
||||
service: "cuddle-rust-service-plan"
|
||||
|
@@ -36,8 +36,13 @@ spec:
|
||||
- configMapRef:
|
||||
name: {{ vars.cuddle_crdb.file_name(service_name) }}
|
||||
{%- endif %}
|
||||
{%- if vars.vault_secret.has_values or vars.cuddle_crdb.has_values %}
|
||||
{%- if vars.cuddle_postgres.has_values %}
|
||||
- configMapRef:
|
||||
name: {{ vars.cuddle_postgres.file_name(service_name) }}
|
||||
{%- endif %}
|
||||
{%- if vars.vault_secret.has_values or vars.cuddle_crdb.has_values or vars.cuddle_postgres.has_values %}
|
||||
env:
|
||||
|
||||
{%- if vars.vault_secret.has_values %}
|
||||
{%- for secret in vars.vault_secret.secrets %}
|
||||
- name: {{secret | upper | replace(".", "_") | replace("-", "_") }}
|
||||
@@ -47,6 +52,19 @@ spec:
|
||||
key: {{ secret }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
{#
|
||||
{%- if vars.cuddle_postgres.has_values %}
|
||||
{%- for env in vars.cuddle_postgres.env %}
|
||||
- name: {{ env | upper | replace(".", "_") | replace("-", "_") }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ vars.cuddle_postgres.file_name(service_name) }}
|
||||
key: {{ env }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
#}
|
||||
|
||||
{#
|
||||
{%- if vars.cuddle_crdb.has_values %}
|
||||
- name: {{vars.cuddle_crdb.env }}
|
||||
|
@@ -17,7 +17,7 @@ steps:
|
||||
- chmod -R 600 ~/.ssh
|
||||
- |
|
||||
cat >$HOME/.ssh/config <<EOL
|
||||
Host git.front.kjuulh.io
|
||||
Host git.kjuulh.io
|
||||
IdentityFile $HOME/.ssh/id_ed25519
|
||||
IdentitiesOnly yes
|
||||
UserKnownHostsFile=/dev/null
|
||||
|
Reference in New Issue
Block a user