From f4515b22a20170bc0481499469b348b820cf7318 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Sat, 11 Apr 2026 15:04:15 +0200 Subject: [PATCH] fix(ci): standardize backend service/image naming to hyphen format --- .woodpecker.yml | 16 ++++++++-------- Dockerfile.simple | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index f40b3b8..2c5476d 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -7,20 +7,20 @@ matrix: - gateway - users - companies - - job_seekers + - job-seekers - customers - payments - employees - photographers - - makeup_artists + - makeup-artists - tutors - developers - - video_editors - - graphic_designers - - social_media_managers - - fitness_trainers - - catering_services - - ugc_content_creators + - video-editors + - graphic-designers + - social-media-managers + - fitness-trainers + - catering-services + - ugc-content-creators - cron steps: diff --git a/Dockerfile.simple b/Dockerfile.simple index e64dad5..96ca6af 100644 --- a/Dockerfile.simple +++ b/Dockerfile.simple @@ -16,12 +16,13 @@ WORKDIR /app COPY Cargo.toml Cargo.lock ./ COPY crates/ ./crates/ -# Copy only the target service source (fast path for matrix builds). -COPY apps/${SERVICE_NAME}/ ./apps/${SERVICE_NAME}/ +# Copy all services so we can map hyphenated service names to underscore crate/bin names. +COPY apps/ ./apps/ # Restrict workspace members to the selected service + shared crates. # This avoids requiring every `apps/*` manifest while preserving workspace deps. -RUN awk -v svc="${SERVICE_NAME}" '\ +RUN svc=$(echo "${SERVICE_NAME}" | tr '-' '_') && \ + awk -v svc="${svc}" '\ BEGIN { in_members = 0 } \ /^members = \[/ { \ print "members = ["; \ @@ -37,22 +38,23 @@ RUN awk -v svc="${SERVICE_NAME}" '\ } \ in_members && /^\]/ { in_members = 0; print "]"; next } \ in_members { next } \ - { print }' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml + { print }' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml && \ + echo "${svc}" > /tmp/service_bin # Build with all optimizations ENV RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-s" ENV OPENSSL_STATIC=1 ENV OPENSSL_DIR=/usr RUN cargo build --release \ - --bin ${SERVICE_NAME} \ - --target x86_64-unknown-linux-musl + --bin $(cat /tmp/service_bin) \ + --target x86_64-unknown-linux-musl && \ + cp /app/target/x86_64-unknown-linux-musl/release/$(cat /tmp/service_bin) /app/service # Runtime FROM scratch -ARG SERVICE_NAME COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/${SERVICE_NAME} /app/service +COPY --from=builder /app/service /app/service USER 65532:65532 EXPOSE 8000