Some checks failed
build-and-release / build (cron) (push) Successful in 49s
build-and-release / build (catering-services) (push) Successful in 1m35s
build-and-release / build (companies) (push) Successful in 1m38s
build-and-release / build (graphic-designers) (push) Successful in 9s
build-and-release / build (developers) (push) Successful in 2m4s
build-and-release / build (customers) (push) Successful in 2m16s
build-and-release / build (employees) (push) Successful in 2m20s
build-and-release / build (gateway) (push) Successful in 57s
build-and-release / build (job-seekers) (push) Successful in 1m39s
build-and-release / build (fitness-trainers) (push) Successful in 2m46s
build-and-release / build (photographers) (push) Successful in 9s
build-and-release / build (jobs) (push) Successful in 1m43s
build-and-release / build (leads) (push) Successful in 1m40s
build-and-release / build (makeup-artists) (push) Successful in 2m28s
build-and-release / build (tutors) (push) Successful in 1m23s
build-and-release / build (payments) (push) Successful in 2m51s
build-and-release / build (social-media-managers) (push) Successful in 2m33s
build-and-release / build (ugc-content-creators) (push) Successful in 2m23s
build-and-release / build (users) (push) Has been cancelled
build-and-release / build (video-editors) (push) Has been cancelled
Dockerfile.migrate copied only crates/db-migrate + a few unrelated crates but left the root Cargo.toml's [workspace] members list referencing every apps/* service, none of which exist in this build context - cargo failed immediately with "failed to load manifest for workspace member apps/gateway". Trim the workspace to just crates/db-migrate (it has no path dependency on anything else per crates/db-migrate/Cargo.toml) using the same awk trick Dockerfile.simple already uses per-service. Also fix the resulting binary output path (workspace builds put target/ at the workspace root, not under the member crate's own directory). k8s-migration-job.yaml targeted namespace: default, where neither nxtgauge-backend-rust-secrets nor a registry pull secret exist - both only exist in the nxtgauge namespace where the actual app runs. Fix the namespace and add the missing imagePullSecrets so the job can actually pull its image and read DATABASE_URL. Neither of these had ever been exercised successfully before - this is the first real migration run since the job/image were added. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
38 lines
1.5 KiB
Text
38 lines
1.5 KiB
Text
FROM ci.nxtgauge.com/admin/rust:alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache curl ca-certificates bash build-base musl-dev pkgconfig openssl-dev openssl-libs-static
|
|
RUN update-ca-certificates
|
|
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
RUN rustup target add x86_64-unknown-linux-musl
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY crates/db-migrate ./crates/db-migrate
|
|
|
|
# The root Cargo.toml's [workspace] members list includes every apps/* service,
|
|
# none of which are copied into this image (db-migrate has no path dependency
|
|
# on them - see crates/db-migrate/Cargo.toml). Restrict the workspace to just
|
|
# this crate so cargo doesn't fail trying to resolve manifests that don't exist
|
|
# in this build context (same trick Dockerfile.simple uses per-service).
|
|
RUN awk '\
|
|
BEGIN { in_members = 0 } \
|
|
/^members = \[/ { print "members = [\n \"crates/db-migrate\"\n]"; in_members = 1; next } \
|
|
in_members && /^\]/ { in_members = 0; next } \
|
|
in_members { next } \
|
|
{ print } \
|
|
' Cargo.toml > Cargo.toml.trimmed && mv Cargo.toml.trimmed Cargo.toml
|
|
|
|
WORKDIR /app/crates/db-migrate
|
|
ENV OPENSSL_STATIC=1
|
|
ENV OPENSSL_DIR=/usr
|
|
RUN cargo build --release --bin db-migrate --target x86_64-unknown-linux-musl
|
|
|
|
FROM ci.nxtgauge.com/admin/alpine:3.20
|
|
RUN apk add --no-cache ca-certificates libpq
|
|
|
|
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/db-migrate /usr/local/bin/
|
|
COPY crates/db/migrations /migrations
|
|
|
|
ENTRYPOINT ["db-migrate"]
|