Skip to content

Commit

Permalink
fix static files upload
Browse files Browse the repository at this point in the history
  • Loading branch information
blarfoon committed Apr 25, 2024
1 parent b7fe907 commit f66134c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ RUN update-ca-certificates
WORKDIR /usr/src/daedalus
COPY . .
RUN cargo build --release
COPY ./target/release/daedalus /usr/src/daedalus/daedalus

CMD ["cargo", "run", "--release"]
CMD ["./daedalus"]
9 changes: 8 additions & 1 deletion daedalus_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ pub async fn upload_static_files(
use path_slash::PathExt as _;
let cdn_upload_dir =
dotenvy::var("CDN_UPLOAD_DIR").unwrap_or("./upload_cdn".to_string());

info!("uploading static files from {}", cdn_upload_dir);

if !std::path::Path::new(&cdn_upload_dir).exists() {
panic!("CDN_UPLOAD_DIR does not exist");
}

for entry in walkdir::WalkDir::new(&cdn_upload_dir) {
let entry = entry?;
if entry.path().is_file() {
Expand All @@ -312,7 +319,7 @@ pub async fn upload_static_files(
)
})?;
info!(
"uploading {} to cnd at path {}",
"uploading {} to cdn at path {}",
entry.path().display(),
upload_path
);
Expand Down

0 comments on commit f66134c

Please sign in to comment.