Skip to content

Commit

Permalink
fix: Publishing failed because migrations were outside of samling crate
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsvante committed Jan 8, 2025
1 parent 5dde489 commit c3d071c
Show file tree
Hide file tree
Showing 164 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target/
/ui/node_modules/
/ui/build/
/samling/ui/node_modules/
/samling/ui/build/
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apk add --no-cache build-base cmake linux-headers \
### UI builder
FROM node:20.6.0-alpine3.18 AS ui_builder
WORKDIR /ui
COPY ./ui/ ./
COPY ./samling/ui/ ./
RUN npm ci

# NOTE: We default to `REACT_APP_API_BASE_URL=/api` to avoid CORS configuration. This
Expand All @@ -38,7 +38,6 @@ WORKDIR /app

COPY /samling/ ./samling/
COPY /samling-clorinde/ ./samling-clorinde/
COPY /migrations/ ./migrations/
COPY Cargo.toml Cargo.lock ./
RUN cargo chef prepare --recipe-path recipe.json

Expand All @@ -56,11 +55,10 @@ ENV LD_PRELOAD=/lib/libmimalloc.so.2 MIMALLOC_LARGE_OS_PAGES=1
COPY --from=api_planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json

COPY --from=ui_builder /ui/build/ ./ui/build/
COPY --from=ui_builder /ui/build/ ./samling/ui/build/

COPY /samling/ ./samling/
COPY /samling-clorinde/ ./samling-clorinde/
COPY /migrations/ ./migrations/
COPY Cargo.toml Cargo.lock ./

RUN cargo build \
Expand Down
4 changes: 2 additions & 2 deletions generate-clorinde-file.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
clorinde \
--queries-path=./queries \
--queries-path=./samling/queries \
--destination=samling-clorinde \
schema \
./migrations/*.sql
./samling/migrations/*.sql
cargo fmt -p samling-clorinde
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion samling/src/db_migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{path::Path, sync::Arc};

use include_dir::{include_dir, Dir};

static MIGRATIONS: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../migrations");
static MIGRATIONS: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/migrations");

use deadpool_postgres::Pool;
use serde::Serialize;
Expand Down
2 changes: 1 addition & 1 deletion samling/src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use axum::http::{status::StatusCode, HeaderMap, HeaderValue};
use include_dir::{include_dir, Dir};

static FILES: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../ui/build");
static FILES: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/ui/build");

/// Serve our create-react-app UI
///
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c3d071c

Please sign in to comment.