Skip to content

Commit

Permalink
Make it possible to build in --release mode in Docker CI and Makefi…
Browse files Browse the repository at this point in the history
…le (#1134)
  • Loading branch information
aldur authored Dec 16, 2024
1 parent 6ccc1f4 commit 069867d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM rust:1.81.0-slim-bookworm AS build

ARG CARGO_BUILD_ARGS="--release"

# Install dependencies.
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
Expand All @@ -20,7 +22,7 @@ RUN npm install -g @openapitools/openapi-generator-cli
WORKDIR /code/sbtc
COPY . .
RUN make install && make build
RUN cargo build --bin blocklist-client
RUN cargo build --bin blocklist-client ${CARGO_BUILD_ARGS}

# Create Docker image to run the signer.
FROM debian:bookworm-slim AS blocklist-client
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/dockerfiles/Dockerfile.signer.debian
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM rust:1.81.0-slim-bookworm AS build

ARG CARGO_BUILD_ARGS="--release"

# Install dependencies.
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
Expand All @@ -20,7 +22,7 @@ RUN npm install -g @openapitools/openapi-generator-cli
WORKDIR /code/sbtc
COPY . .
RUN make install && make build
RUN cargo build --bin signer
RUN cargo build --bin signer ${CARGO_BUILD_ARGS}

# Create Docker image to run the signer.
FROM debian:bookworm-slim AS signer
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ install:
pnpm install

build: $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT) $(AUTOGENERATED_EMILY_CLIENT)
cargo build
cargo build ${CARGO_BUILD_ARGS}
pnpm --recursive build
# TODO(719): No need to do this once rustfmt 2.0.0 ships
# Format generated sources:
Expand Down Expand Up @@ -159,7 +159,7 @@ $(AUTOGENERATED_EMILY_CLIENT): $(INSTALL_TARGET) $(EMILY_OPENAPI_SPEC)

# Build the OpenAPI specification.
$(EMILY_OPENAPI_SPEC): $(INSTALL_TARGET) $(EMILY_HANDLER_SOURCE_FILES)
cargo build --package $(EMILY_OPENAPI_SPEC_PROJECT_NAME)
cargo build --package $(EMILY_OPENAPI_SPEC_PROJECT_NAME) ${CARGO_BUILD_ARGS}
cargo fmt -p "$(EMILY_OPENAPI_SPEC_PROJECT_NAME)"

# Devenv
Expand Down Expand Up @@ -194,7 +194,7 @@ $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT): $(BLOCKLIST_OPENAPI_SPEC)
# Generate the OpenAPI spec for Blocklist Client
BLOCKLIST_OPENAPI_SPEC_SOURCE_FILES := $(filter-out $(BLOCKLIST_OPENAPI_SPEC), $(wildcard $(subst dir, $(BLOCKLIST_OPENAPI_PATH), $(THREE_DIRS_DEEP))))
$(BLOCKLIST_OPENAPI_SPEC): $(INSTALL_TARGET) $(BLOCKLIST_OPENAPI_SPEC_SOURCE_FILES)
cargo build --package blocklist-openapi-gen
cargo build --package blocklist-openapi-gen ${CARGO_BUILD_ARGS}
cargo fmt -p blocklist-openapi-gen

# Signer
Expand Down

0 comments on commit 069867d

Please sign in to comment.