This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
use cuddle_ci::{Context, MainAction, PullRequestAction};
|
use cuddle_ci::{Context, MainAction, PullRequestAction};
|
||||||
use dagger_sdk::{
|
use dagger_sdk::{Container, HostDirectoryOptsBuilder, PortForward, ServiceUpOptsBuilder};
|
||||||
Container, HostDirectoryOptsBuilder, PortForward, QueryContainerOptsBuilder,
|
|
||||||
ServiceUpOptsBuilder,
|
|
||||||
};
|
|
||||||
|
|
||||||
const UPDATE_DEPLOYMENT_IMAGE: &str = "docker.io/kasperhermansen/update-deployment:1690401410";
|
const UPDATE_DEPLOYMENT_IMAGE: &str = "docker.io/kasperhermansen/update-deployment:1690401410";
|
||||||
|
|
||||||
const ZOLA_VERSION: &str = "0.17.2-1";
|
const CADDY_IMAGE: &str = "caddy:v2.10.0";
|
||||||
const DEBIAN_EDITION: &str = "bullseye";
|
|
||||||
|
const ZOLA_VERSION: &str = "0.21.0";
|
||||||
|
const DEBIAN_EDITION: &str = "bookworm";
|
||||||
const DEBIAN_PLATFORM: &str = "amd64";
|
const DEBIAN_PLATFORM: &str = "amd64";
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -72,8 +71,8 @@ async fn build(client: dagger_sdk::Query) -> eyre::Result<(i64, Container)> {
|
|||||||
.container()
|
.container()
|
||||||
.from("node:16")
|
.from("node:16")
|
||||||
.with_workdir("/app")
|
.with_workdir("/app")
|
||||||
.with_directory(".", src.id().await?)
|
.with_directory(".", src.clone())
|
||||||
.with_mounted_cache("node_modules", node_cache.id().await?)
|
.with_mounted_cache("node_modules", node_cache)
|
||||||
.with_exec(vec!["yarn"])
|
.with_exec(vec!["yarn"])
|
||||||
.with_exec(vec!["yarn", "compile"])
|
.with_exec(vec!["yarn", "compile"])
|
||||||
.file("static/styles/styles.css");
|
.file("static/styles/styles.css");
|
||||||
@@ -90,7 +89,7 @@ async fn build(client: dagger_sdk::Query) -> eyre::Result<(i64, Container)> {
|
|||||||
.with_exec(vec!["apt", "update"])
|
.with_exec(vec!["apt", "update"])
|
||||||
.with_exec(vec!["apt", "install", "wget", "-y"])
|
.with_exec(vec!["apt", "install", "wget", "-y"])
|
||||||
.with_workdir("/mnt")
|
.with_workdir("/mnt")
|
||||||
.with_mounted_cache("/mnt", debian_cache.id().await?)
|
.with_mounted_cache("/mnt", debian_cache)
|
||||||
.with_exec(vec!["wget", &github_zola_download])
|
.with_exec(vec!["wget", &github_zola_download])
|
||||||
.with_exec(vec![
|
.with_exec(vec![
|
||||||
"dpkg",
|
"dpkg",
|
||||||
@@ -98,18 +97,18 @@ async fn build(client: dagger_sdk::Query) -> eyre::Result<(i64, Container)> {
|
|||||||
format!("zola_{ZOLA_VERSION}_{DEBIAN_PLATFORM}_{DEBIAN_EDITION}.deb").as_str(),
|
format!("zola_{ZOLA_VERSION}_{DEBIAN_PLATFORM}_{DEBIAN_EDITION}.deb").as_str(),
|
||||||
])
|
])
|
||||||
.with_workdir("/app")
|
.with_workdir("/app")
|
||||||
.with_directory(".", src.id().await?)
|
.with_directory(".", src)
|
||||||
.with_file("static/styles/styles.css", styles_file.id().await?)
|
.with_file("static/styles/styles.css", styles_file)
|
||||||
.with_exec(vec!["zola", "build"])
|
.with_exec(vec!["zola", "build"])
|
||||||
.directory("public");
|
.directory("public");
|
||||||
|
|
||||||
let caddy_file = client.host().directory("deployment").file("Caddyfile");
|
let caddy_file = client.host().directory("deployment").file("Caddyfile");
|
||||||
|
|
||||||
let dep_image = client
|
let dep_image = client
|
||||||
.container_opts(QueryContainerOptsBuilder::default().build().unwrap())
|
.container()
|
||||||
.from("caddy")
|
.from(CADDY_IMAGE)
|
||||||
.with_directory("/usr/share/caddy", dist_dir.id().await.unwrap())
|
.with_directory("/usr/share/caddy", dist_dir)
|
||||||
.with_file("/etc/caddy/Caddyfile", caddy_file.id().await.unwrap());
|
.with_file("/etc/caddy/Caddyfile", caddy_file);
|
||||||
|
|
||||||
Ok((tag, dep_image))
|
Ok((tag, dep_image))
|
||||||
}
|
}
|
||||||
|
@@ -5,4 +5,5 @@
|
|||||||
http://blog.kasperhermansen.com {
|
http://blog.kasperhermansen.com {
|
||||||
root * /usr/share/caddy
|
root * /usr/share/caddy
|
||||||
file_server
|
file_server
|
||||||
|
encode gzip
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user