Skip to content

Commit

Permalink
build(ci): fix determinisc build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
keplervital committed Dec 4, 2024
1 parent 43ebe4c commit 02a54b6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Define the BUILD_MODE argument with a default value of "production"
ARG BUILD_MODE=production
ARG TARGETPLATFORM=linux/amd64

# Operating system with basic tools
FROM --platform=linux/amd64 ubuntu@sha256:bbf3d1baa208b7649d1d0264ef7d522e1dc0deeeaaf6085bf8e4618867f03494 as base
FROM ubuntu:20.04 AS base
SHELL ["bash", "-c"]
ENV TZ=UTC
ENV LC_ALL=C.UTF-8
Expand All @@ -14,7 +15,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
git jq npm xxd file curl unzip

# Code specific dependencies
FROM base as builder
FROM base AS builder
SHELL ["bash", "-c"]
WORKDIR /code
ARG BUILD_MODE
Expand Down Expand Up @@ -47,7 +48,7 @@ RUN eval "$(fnm env)" && \
pnpm install --frozen-lockfile

# Build the Orbit Upgrader Canister
FROM builder as build_upgrader
FROM builder AS build_upgrader
SHELL ["bash", "-c"]
WORKDIR /code
LABEL io.icp.artifactType="canister" \
Expand All @@ -57,7 +58,7 @@ RUN eval "$(fnm env)" && \
npx nx run upgrader:create-artifacts

# Build the Orbit Station Canister
FROM builder as build_station
FROM builder AS build_station
SHELL ["bash", "-c"]
WORKDIR /code
LABEL io.icp.artifactType="canister" \
Expand All @@ -67,7 +68,7 @@ RUN eval "$(fnm env)" && \
npx nx run station:create-artifacts

# Build the Orbit Control Panel
FROM builder as build_control_panel
FROM builder AS build_control_panel
SHELL ["bash", "-c"]
WORKDIR /code
LABEL io.icp.artifactType="canister" \
Expand All @@ -77,7 +78,7 @@ RUN eval "$(fnm env)" && \
npx nx run control-panel:create-artifacts

# Build the Orbit Wallet Frontend Assets
FROM builder as build_wallet_dapp
FROM builder AS build_wallet_dapp
SHELL ["bash", "-c"]
WORKDIR /code
LABEL io.icp.artifactType="canister" \
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/build/main.build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default defineConfig(_ => {
withCanisterIds({ isProduction }),
withApiCompatibilityFile(),
withVersionedEntrypoint(),
withIcAssetsFile(isProduction && MODE !== 'localhost'),
withIcAssetsFile({ isProduction }),
],
build: {
target: 'es2022',
Expand Down
8 changes: 5 additions & 3 deletions apps/wallet/build/plugins/with-ic-assets.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ const createICAssetsJson = (
};

export const withIcAssetsFile = (
isProduction = true,
publicDir = 'public',
fileName = '.ic-assets.json',
opts: { isProduction?: boolean; publicDir?: string; fileName?: string } = {},
): Plugin => {
const isProduction = opts.isProduction ?? true;
const publicDir = opts.publicDir ?? 'public';
const fileName = opts.fileName ?? '.ic-assets.json';

return {
name: 'with-ic-assets',
writeBundle({ dir }) {
Expand Down

0 comments on commit 02a54b6

Please sign in to comment.