Skip to content

Commit

Permalink
ci: switch yarn to corepack
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Dec 11, 2024
1 parent bdaba27 commit 352b702
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions oada/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ WORKDIR /oada

# Need to list out every package.json we need from monorepo for caching stuff...
COPY --link ./yarn.lock ./.yarnrc.yml /oada/
COPY --link ./.yarn /oada/.yarn
# TODO: How to COPY all package.json files with glob?
COPY ./package.json /oada/package.json
COPY ./libs/models/package.json /oada/libs/models/package.json
Expand Down Expand Up @@ -37,27 +36,27 @@ FROM packages AS yarn
COPY --link . /oada/

# Run again to be safe?
RUN yarn workspaces focus --all --production
RUN corepack yarn workspaces focus --all --production

# Install all deps and run build step
# Allows for workspaces to have build step (e.g., for TypeScript)
FROM packages AS dev

# Install _all_ dependencies for build
RUN yarn install --immutable
RUN corepack yarn install --immutable

# Copy in actual code
COPY --link . /oada/

# Run again to be safe?
RUN yarn install --immutable
RUN corepack yarn install --immutable

RUN yarn sdks vscode vim
RUN corepack yarn sdks vscode vim

FROM dev AS build

# Build and then remove yarn stuff
RUN yarn build --verbose && rm -rfv .yarn .pnp.*
RUN corepack yarn build --verbose && rm -rfv .yarn .pnp.*

FROM node:${NODE_VER} AS code

Expand Down
4 changes: 2 additions & 2 deletions oada/utils/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh

# Use yarn workspace as "entry point"
CMD="yarn workspace @oada/${OADA_SERVICE} run $*"
CMD="corepack yarn workspace @oada/${OADA_SERVICE} run $*"

# Wait for startup, then run CMD.
([ "${OADA_SERVICE}" = "startup" ] || /wait-for startup:8080 -q -t 0) &&
Expand All @@ -15,4 +15,4 @@ CMD="yarn workspace @oada/${OADA_SERVICE} run $*"
else
# Interactive or no transport set?
exec ${CMD}
fi
fi

0 comments on commit 352b702

Please sign in to comment.