mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-02 06:46:15 -07:00
Compare commits
1 Commits
feature/us
...
fix/skip-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71a0700bfa |
17
dist/index.js
generated
vendored
17
dist/index.js
generated
vendored
@@ -9419,6 +9419,10 @@ class ContainerHookService {
|
|||||||
fi
|
fi
|
||||||
ENDPOINT_ARGS=""
|
ENDPOINT_ARGS=""
|
||||||
if [ -n "$AWS_S3_ENDPOINT" ]; then ENDPOINT_ARGS="--endpoint-url $AWS_S3_ENDPOINT"; fi
|
if [ -n "$AWS_S3_ENDPOINT" ]; then ENDPOINT_ARGS="--endpoint-url $AWS_S3_ENDPOINT"; fi
|
||||||
|
# Skip uploading empty or near-empty tar files (< 1KB) — these are leftover
|
||||||
|
# stubs with no real cache data and would poison the cache for the next build.
|
||||||
|
find /data/cache/$CACHE_KEY/lfs -name "*.tar*" -size -1k -delete 2>/dev/null || true
|
||||||
|
find /data/cache/$CACHE_KEY/Library -name "*.tar*" -size -1k -delete 2>/dev/null || true
|
||||||
aws $ENDPOINT_ARGS s3 cp --recursive /data/cache/$CACHE_KEY/lfs s3://${orchestrator_1.default.buildParameters.awsStackName}/orchestrator-cache/$CACHE_KEY/lfs || true
|
aws $ENDPOINT_ARGS s3 cp --recursive /data/cache/$CACHE_KEY/lfs s3://${orchestrator_1.default.buildParameters.awsStackName}/orchestrator-cache/$CACHE_KEY/lfs || true
|
||||||
rm -r /data/cache/$CACHE_KEY/lfs || true
|
rm -r /data/cache/$CACHE_KEY/lfs || true
|
||||||
aws $ENDPOINT_ARGS s3 cp --recursive /data/cache/$CACHE_KEY/Library s3://${orchestrator_1.default.buildParameters.awsStackName}/orchestrator-cache/$CACHE_KEY/Library || true
|
aws $ENDPOINT_ARGS s3 cp --recursive /data/cache/$CACHE_KEY/Library s3://${orchestrator_1.default.buildParameters.awsStackName}/orchestrator-cache/$CACHE_KEY/Library || true
|
||||||
@@ -9912,13 +9916,14 @@ echo "CACHE_KEY=$CACHE_KEY"`;
|
|||||||
if ! command -v yarn > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/yarn && chmod +x /usr/local/bin/yarn; fi
|
if ! command -v yarn > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/yarn && chmod +x /usr/local/bin/yarn; fi
|
||||||
# Pipe entrypoint.sh output through log stream to capture Unity build output (including "Build succeeded")
|
# Pipe entrypoint.sh output through log stream to capture Unity build output (including "Build succeeded")
|
||||||
{ echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh; } | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
{ echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh; } | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||||
|
# Ensure cache directories exist for post-build and S3 upload hooks.
|
||||||
|
# Do NOT create empty placeholder tars — they waste S3 storage and on next
|
||||||
|
# build the pull-cache hook downloads them, giving Unity an empty Library
|
||||||
|
# (no caching benefit). The real tars are created by remote-cli-post-build
|
||||||
|
# via Caching.PushToCache(), and the S3 upload hooks use || true so missing
|
||||||
|
# files are handled gracefully.
|
||||||
mkdir -p "/data/cache/$CACHE_KEY/Library"
|
mkdir -p "/data/cache/$CACHE_KEY/Library"
|
||||||
if [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar.lz4" ]; then
|
mkdir -p "/data/cache/$CACHE_KEY/build"
|
||||||
tar -cf "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar"
|
|
||||||
fi
|
|
||||||
if [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar.lz4" ]; then
|
|
||||||
tar -cf "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar"
|
|
||||||
fi
|
|
||||||
# Run post-build tasks and capture output
|
# Run post-build tasks and capture output
|
||||||
# Note: Post-build may clean up the builder directory, so we write output directly to log file
|
# Note: Post-build may clean up the builder directory, so we write output directly to log file
|
||||||
# Use set +e to allow the command to fail without exiting the script
|
# Use set +e to allow the command to fail without exiting the script
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -155,6 +155,10 @@ export class ContainerHookService {
|
|||||||
fi
|
fi
|
||||||
ENDPOINT_ARGS=""
|
ENDPOINT_ARGS=""
|
||||||
if [ -n "$AWS_S3_ENDPOINT" ]; then ENDPOINT_ARGS="--endpoint-url $AWS_S3_ENDPOINT"; fi
|
if [ -n "$AWS_S3_ENDPOINT" ]; then ENDPOINT_ARGS="--endpoint-url $AWS_S3_ENDPOINT"; fi
|
||||||
|
# Skip uploading empty or near-empty tar files (< 1KB) — these are leftover
|
||||||
|
# stubs with no real cache data and would poison the cache for the next build.
|
||||||
|
find /data/cache/$CACHE_KEY/lfs -name "*.tar*" -size -1k -delete 2>/dev/null || true
|
||||||
|
find /data/cache/$CACHE_KEY/Library -name "*.tar*" -size -1k -delete 2>/dev/null || true
|
||||||
aws $ENDPOINT_ARGS s3 cp --recursive /data/cache/$CACHE_KEY/lfs s3://${
|
aws $ENDPOINT_ARGS s3 cp --recursive /data/cache/$CACHE_KEY/lfs s3://${
|
||||||
Orchestrator.buildParameters.awsStackName
|
Orchestrator.buildParameters.awsStackName
|
||||||
}/orchestrator-cache/$CACHE_KEY/lfs || true
|
}/orchestrator-cache/$CACHE_KEY/lfs || true
|
||||||
|
|||||||
@@ -170,13 +170,14 @@ echo "CACHE_KEY=$CACHE_KEY"`;
|
|||||||
if ! command -v yarn > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/yarn && chmod +x /usr/local/bin/yarn; fi
|
if ! command -v yarn > /dev/null 2>&1; then printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/yarn && chmod +x /usr/local/bin/yarn; fi
|
||||||
# Pipe entrypoint.sh output through log stream to capture Unity build output (including "Build succeeded")
|
# Pipe entrypoint.sh output through log stream to capture Unity build output (including "Build succeeded")
|
||||||
{ echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh; } | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
{ echo "game ci start"; echo "game ci start" >> /home/job-log.txt; echo "CACHE_KEY=$CACHE_KEY"; echo "$CACHE_KEY"; if [ -n "$LOCKED_WORKSPACE" ]; then echo "Retained Workspace: true"; fi; if [ -n "$LOCKED_WORKSPACE" ] && [ -d "$GITHUB_WORKSPACE/.git" ]; then echo "Retained Workspace Already Exists!"; fi; /entrypoint.sh; } | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
|
||||||
|
# Ensure cache directories exist for post-build and S3 upload hooks.
|
||||||
|
# Do NOT create empty placeholder tars — they waste S3 storage and on next
|
||||||
|
# build the pull-cache hook downloads them, giving Unity an empty Library
|
||||||
|
# (no caching benefit). The real tars are created by remote-cli-post-build
|
||||||
|
# via Caching.PushToCache(), and the S3 upload hooks use || true so missing
|
||||||
|
# files are handled gracefully.
|
||||||
mkdir -p "/data/cache/$CACHE_KEY/Library"
|
mkdir -p "/data/cache/$CACHE_KEY/Library"
|
||||||
if [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar.lz4" ]; then
|
mkdir -p "/data/cache/$CACHE_KEY/build"
|
||||||
tar -cf "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/Library/lib-$BUILD_GUID.tar"
|
|
||||||
fi
|
|
||||||
if [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" ] && [ ! -f "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar.lz4" ]; then
|
|
||||||
tar -cf "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar" --files-from /dev/null || touch "/data/cache/$CACHE_KEY/build/build-$BUILD_GUID.tar"
|
|
||||||
fi
|
|
||||||
# Run post-build tasks and capture output
|
# Run post-build tasks and capture output
|
||||||
# Note: Post-build may clean up the builder directory, so we write output directly to log file
|
# Note: Post-build may clean up the builder directory, so we write output directly to log file
|
||||||
# Use set +e to allow the command to fail without exiting the script
|
# Use set +e to allow the command to fail without exiting the script
|
||||||
|
|||||||
Reference in New Issue
Block a user