Skip to content

Commit

Permalink
Some more testing and trying
Browse files Browse the repository at this point in the history
  • Loading branch information
SleeplessByte committed Jul 29, 2024
1 parent 6dbfec4 commit 291e65e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN set -ex; \
corepack enable; \
# install corepack globally with the last known good version of yarn
corepack pack -o ./corepack.tgz; \
COREPACK_ENABLE_NETWORK=0 corepack install -g "./corepack.tgz"; \
COREPACK_ENABLE_NETWORK=0 COREPACK_HOME=/home/appuser/.cache/node/corepack corepack install -g "./corepack.tgz"; \
# install all the development modules (used for building)
yarn cache clean; \
yarn install; \
Expand All @@ -38,7 +38,9 @@ RUN set -ex; \
#
# TODO: yarn workspaces focus --production;

# Disable network for corepack
ENV COREPACK_ENABLE_NETWORK=0
# Prefer offline mode for yarn
ENV YARN_ENABLE_OFFLINE_MODE=1

USER appuser
Expand Down
10 changes: 7 additions & 3 deletions bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,24 @@ result_file="${OUTPUT}results.json"

# Check yarn
if test -f "$ROOT/corepack.tgz"; then
YARN_ENABLE_OFFLINE_MODE=1 yarn -v

# COREPACK_ENABLE_NETWORK=0 corepack install -g "$ROOT/corepack.tgz"
echo "'$ROOT/corepack.tgz' found. Expect global yarn to be available."
else
echo "Did not find '$ROOT/corepack.tgz'. You either need network access or run corepack pack first when network is enabled."
ls -aln1 "$ROOT"

fi;

echo "Yarn version now: "
YARN_ENABLE_OFFLINE_MODE=1 yarn -v
which yarn
echo ""
echo "------------------------------------"
echo "---------------------------------------------------------------"

if test -f "${OUTPUT}package.json"; then
echo "Standalone package found" #, installing packages from cache"
cd "${OUTPUT}" && YARN_ENABLE_NETWORK=false YARN_ENABLE_HARDENED_MODE=false YARN_ENABLE_OFFLINE_MODE=true YARN_ENABLE_GLOBAL_CACHE=false yarn install --immutable
echo "---------------------------------------------------------------"
fi;

# Disable auto exit
Expand Down Expand Up @@ -216,6 +218,7 @@ fi;

if [ $test_exit -eq 2 ]
then
echo ""
echo "tsc compilation failed"

# Restore babel.config.js and package.json
Expand Down Expand Up @@ -243,6 +246,7 @@ then
# Test runner didn't fail!
exit 0
else
echo ""
echo "tsc compilation success"
fi

Expand Down

0 comments on commit 291e65e

Please sign in to comment.