From 7750334d0eb46d092e7156f5580e18816e5b0c13 Mon Sep 17 00:00:00 2001 From: Lachee Date: Thu, 18 Sep 2025 14:09:49 +1000 Subject: [PATCH 1/4] WIP: Mega Image --- .../workflows/scripts/build-runner-image.sh | 109 ++++++++++++++++++ Dockerfile | 40 +++++++ test.sh | 4 + 3 files changed, 153 insertions(+) create mode 100644 .gitea/workflows/scripts/build-runner-image.sh create mode 100644 test.sh diff --git a/.gitea/workflows/scripts/build-runner-image.sh b/.gitea/workflows/scripts/build-runner-image.sh new file mode 100644 index 0000000..4be1b3a --- /dev/null +++ b/.gitea/workflows/scripts/build-runner-image.sh @@ -0,0 +1,109 @@ +#!/bin/sh +# Ensure UNITY_VERSION is set, pull from arguments if not +if [ -z "${UNITY_VERSION}" ]; then + if [ -n "$1" ]; then + UNITY_VERSION=$1 + else + echo "Error: UNITY_VERSION is not set." + exit 1 + fi +fi + +# Fetch the changelog and extract the changeset ID for the specified Unity version +CHANGELOG_URL="https://public-cdn.cloud.unity3d.com/hub/prod/releases-${UNITY_VERSION}.json" +CHANGESET_ID=$(curl -s "$CHANGELOG_URL" | grep -o '"changeset":[^,]*' | head -n 1 | cut -d':' -f2 | tr -d ' "') + +if [ -z "$CHANGESET_ID" ]; then + echo "Warning: Could not retrieve changeset ID for Unity version ${UNITY_VERSION}." +else + echo "Unity ${UNITY_VERSION} changeset ID: ${CHANGESET_ID}" +fi + +# Ensure we have some modules +if [ -z "${UNITY_MODULES}" ]; then + if [ -n "$3" ]; then + UNITY_MODULES=$3 + else + echo "Error: UNITY_MODULES is not set." + exit 1 + fi +fi + +# Ensure IMAGE is set, pull from arguments if not +if [ -z "${IMAGE}" ]; then + if [ -n "$3" ]; then + IMAGE=$3 + else + echo "Error: IMAGE is not set." + exit 1 + fi +fi + +# Ensure GAME_CI_VERSION is set, default to 3 if not +if [ -z "${GAMECI_VERSION}" ]; then + GAMECI_VERSION=3 +fi + +# Ensure IMAGE_OS is set, default to ubuntu if not +if [ -z "${GAMECI_OS}" ]; then + + # windows-il2cpp requires windows OS + if [ "${UNITY_PLATFORM}" = "windows-il2cpp" ]; then + GAMECI_OS="windows" + else + GAMECI_OS="ubuntu" + fi + + # TODO: MacOS probably requires a mac image. + # Might be worth just putting this in the strategy at this point +fi + +# Ensure PLATFORM is set, default to the current system if not +if [ -z "${PLATFORM}" ]; then + PLATFORM=$(uname -m) + case "${PLATFORM}" in + x86_64) PLATFORM="linux/amd64" ;; + arm64) PLATFORM="linux/arm64" ;; + *) + echo "Error: Unsupported platform ${PLATFORM}." + exit 1 + ;; + esac +fi + +# Ensure some additional build settings are set +if [ -z "${DOCKER_BUILD_ARGS}" ]; then + DOCKER_BUILD_ARGS="" +fi + +BASE_TAG=${GAMECI_OS}-${UNITY_VERSION}-base-${GAMECI_VERSION} +BASE_IMAGE=unityci/editor:${BASE_TAG} +DEST_TAG=${GAMECI_OS}-${UNITY_VERSION}-runner +DEST_IMAGE=${IMAGE}:${DEST_TAG} + +echo "Building Docker image ${DEST_IMAGE}" +echo "- Platfrom: ${PLATFORM}" +echo "- Base: ${BASE_IMAGE}" +echo "- Tag: ${DEST_TAG}" +echo "- Image: ${DEST_IMAGE}" + +docker build \ + --platform ${PLATFORM} \ + --build-arg "VERSION=${UNITY_VERSION}" \ + --build-arg "BASE_IMAGE=${BASE_IMAGE}" \ + --build-arg "MODULE=${UNITY_MODULES}" \ + -t ${DEST_IMAGE} \ + ${DOCKER_BUILD_ARGS} \ + . + +if [ $? -ne 0 ]; then + echo "Error: Docker build failed." + exit 1 +fi + +# Export IMAGE and TAG for GitHub Actions +if [ -n "$GITHUB_OUTPUT" ]; then + echo "IMAGE=${IMAGE}" >> $GITHUB_OUTPUT + echo "TAG=$DEST_TAG" >> $GITHUB_OUTPUT + echo "FULL_IMAGE=${DEST_IMAGE}" >> $GITHUB_OUTPUT +fi diff --git a/Dockerfile b/Dockerfile index fd7f140..645ea18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,45 @@ ARG BASE_IMAGE=unityci/editor +ARG HUB_IMAGE="unityci/hub" +########################### +# Builder # +########################### +FROM $HUB_IMAGE AS builder +# Install editor +ARG VERSION +ARG CHANGE_SET +RUN unity-hub install --version "$VERSION" --changeset "$CHANGE_SET" | \ + tee /var/log/install-editor.log && grep 'Failed to install\|Error while installing an editor\|Completed with errors' /var/log/install-editor.log | \ + exit $(wc -l) + +# Install modules for that editor +ARG MODULE="non-existent-module" +RUN for mod in $MODULE; do \ + if [ "$mod" = "base" ] ; then \ + echo "running default modules for this baseOs"; \ + else \ + unity-hub install-modules --version "$VERSION" --module "$mod" --childModules | tee /var/log/install-module-${mod}.log && \ + grep 'Missing module\|Completed with errors' /var/log/install-module-${mod}.log | exit $(wc -l); \ + fi \ + done \ + # Set execute permissions for modules + && chmod -R 755 /opt/unity/editors/$VERSION/Editor/Data/PlaybackEngines + +RUN echo "$VERSION-$MODULE" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*linux' \ + && exit 0 \ + || unity-hub install-modules --version "$VERSION" --module "linux-server" --childModules | \ + tee /var/log/install-module-linux-server.log && grep 'Missing module' /var/log/install-module-linux-server.log | exit $(wc -l); + +RUN echo "$VERSION-$MODULE" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*windows' \ + && exit 0 \ + || unity-hub install-modules --version "$VERSION" --module "windows-server" --childModules | \ + tee /var/log/install-module-windows-server.log && grep 'Missing module' /var/log/install-module-windows-server.log | exit $(wc -l); + + + +########################### +# Editor # +########################### FROM $BASE_IMAGE RUN apt-get update && \ apt-get install -y \ diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..1091168 --- /dev/null +++ b/test.sh @@ -0,0 +1,4 @@ +UNITY_VERSION=6000.0.35f1 \ +UNITY_MODULES="webgl linux-server windows-mono mac-mono linux-il2cpp" \ +IMAGE=docker.lakes.house/unityci/editor \ + ./.gitea/workflows/scripts/build-runner-image.sh \ No newline at end of file From 9773ac75103d76891d5382157d484e7746020c0b Mon Sep 17 00:00:00 2001 From: Lachee Date: Thu, 18 Sep 2025 14:10:18 +1000 Subject: [PATCH 2/4] added a todo --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 71eeccd..4223e2b 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,10 @@ A table of available Docker images for Unity CI/CD: |---------|----------|----------|----------|----------|----------|----------| | 6000.0.35f1 |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-android-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-ios-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-linux-il2cpp-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-mac-mono-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-webgl-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-windows-mono-runner) | + + +TODO: +https://github.com/mob-sakai/unity-changeset/blob/main/src/unityGraphQL.ts + +use this library to get the change set. +Might as well orchestrate the build with it too. \ No newline at end of file From 046c8e195bfc6c826415b71362ed888e329b99c1 Mon Sep 17 00:00:00 2001 From: Lachee Date: Fri, 19 Sep 2025 15:09:36 +1000 Subject: [PATCH 3/4] Updated build scripts --- .gitea/workflows/create-image.yaml | 8 +-- .gitea/workflows/create-runner.yaml | 50 ++++++++++++++++++ ...ild-image.sh => build-individual-image.sh} | 3 +- .../workflows/scripts/build-runner-image.sh | 24 +++++---- .github/workflows/create-image.yaml | 4 +- .github/workflows/create-runner.yaml | 52 +++++++++++++++++++ dockerfiles/individual.dockerfile | 41 +++++++++++++++ Dockerfile => dockerfiles/runner.dockerfile | 18 ++++--- test.sh | 4 -- 9 files changed, 175 insertions(+), 29 deletions(-) create mode 100644 .gitea/workflows/create-runner.yaml rename .gitea/workflows/scripts/{build-image.sh => build-individual-image.sh} (97%) mode change 100755 => 100644 create mode 100644 .github/workflows/create-runner.yaml create mode 100644 dockerfiles/individual.dockerfile rename Dockerfile => dockerfiles/runner.dockerfile (88%) delete mode 100644 test.sh diff --git a/.gitea/workflows/create-image.yaml b/.gitea/workflows/create-image.yaml index 7b6b6ec..2711e46 100644 --- a/.gitea/workflows/create-image.yaml +++ b/.gitea/workflows/create-image.yaml @@ -1,9 +1,9 @@ -name: Create Images +name: 🤓 Individual Runners on: - push: - branches: [main] - paths: ['versions.txt'] + # push: + # branches: [main] + # paths: ['versions.txt'] workflow_dispatch: inputs: diff --git a/.gitea/workflows/create-runner.yaml b/.gitea/workflows/create-runner.yaml new file mode 100644 index 0000000..a7edf54 --- /dev/null +++ b/.gitea/workflows/create-runner.yaml @@ -0,0 +1,50 @@ +name: 😎 Uber Runner + +on: + push: + branches: [main] + paths: + - versions.txt + - dockerfiles/runner.dockerfile + - .github/workflows/create-runner.yaml + +jobs: + build-docker: + runs-on: ubuntu-latest + env: + DOCKER_REGISTRY: docker.lakes.house/ + UNITY_MODULES: webgl android ios mac-mono windows-mono linux-il2cpp + GAMECI_VERSION: 3 + + name: Build + steps: + - uses: actions/checkout@v4 + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Get Unity Version + run: | + VERSION=$(head -n 1 versions.txt) + echo "UNITY_VERSION=$VERSION" >> $GITHUB_ENV + echo "Unity Version: $VERSION" + + - name: Docker Build + run: .gitea/workflows/scripts/build-runner-image.sh + id: build-image + env: + UNITY_VERSION: ${{ env.UNITY_VERSION }} + UNITY_MODULES: ${{ env.UNITY_MODULES }} + GAMECI_VERSION: ${{ env.GAMECI_VERSION }} + GAMECI_OS: ubuntu + IMAGE: ${{ env.DOCKER_REGISTRY }}unityci/editor + + - name: Docker Push + run: | + echo "Pushing Docker Image ${{ steps.build-image.outputs.FULL_IMAGE }}" + echo "- Image: ${{ steps.build-image.outputs.IMAGE }}" + echo "- Tag: ${{ steps.build-image.outputs.TAG }}" + docker push ${{ steps.build-image.outputs.FULL_IMAGE }} \ No newline at end of file diff --git a/.gitea/workflows/scripts/build-image.sh b/.gitea/workflows/scripts/build-individual-image.sh old mode 100755 new mode 100644 similarity index 97% rename from .gitea/workflows/scripts/build-image.sh rename to .gitea/workflows/scripts/build-individual-image.sh index bc51702..1d08962 --- a/.gitea/workflows/scripts/build-image.sh +++ b/.gitea/workflows/scripts/build-individual-image.sh @@ -85,8 +85,7 @@ docker build \ --build-arg BASE_IMAGE=${BASE_IMAGE} \ ${ADDITIONAL_TAGS} \ -t ${FULL_IMAGE} \ - ${DOCKER_BUILD_ARGS} \ - . + ${DOCKER_BUILD_ARGS} dockerfiles/individual.dockerfile if [ $? -ne 0 ]; then echo "Error: Docker build failed." diff --git a/.gitea/workflows/scripts/build-runner-image.sh b/.gitea/workflows/scripts/build-runner-image.sh index 4be1b3a..a35d580 100644 --- a/.gitea/workflows/scripts/build-runner-image.sh +++ b/.gitea/workflows/scripts/build-runner-image.sh @@ -10,13 +10,16 @@ if [ -z "${UNITY_VERSION}" ]; then fi # Fetch the changelog and extract the changeset ID for the specified Unity version -CHANGELOG_URL="https://public-cdn.cloud.unity3d.com/hub/prod/releases-${UNITY_VERSION}.json" -CHANGESET_ID=$(curl -s "$CHANGELOG_URL" | grep -o '"changeset":[^,]*' | head -n 1 | cut -d':' -f2 | tr -d ' "') - -if [ -z "$CHANGESET_ID" ]; then - echo "Warning: Could not retrieve changeset ID for Unity version ${UNITY_VERSION}." -else - echo "Unity ${UNITY_VERSION} changeset ID: ${CHANGESET_ID}" +# This is because hub doesnt remember every version of unity and uses the changset for the exact id lookup. +if [ -z "${UNITY_CHANGESET}" ]; then + echo "Warning: No changeset provided. Scraping one from the change logs." + echo "This might take a while. Use the UNITY_CHANGESET to avoid this lookup." + CHANGELOG_URL="https://unity.com/releases/editor/whats-new/${UNITY_VERSION}" + UNITY_CHANGESET=$(curl -s -r 0-500 "$CHANGELOG_URL" | grep -oP 'unityhub://(?:[0-9a-z.])+/\K([a-z0-9]+)' | head -n 1) + if [ -z "$UNITY_CHANGESET" ]; then + echo "Error: Could not extract changeset for Unity version ${UNITY_VERSION}." + exit 1 + fi fi # Ensure we have some modules @@ -82,6 +85,8 @@ DEST_TAG=${GAMECI_OS}-${UNITY_VERSION}-runner DEST_IMAGE=${IMAGE}:${DEST_TAG} echo "Building Docker image ${DEST_IMAGE}" +echo "- Version: ${UNITY_VERSION}" +echo "- Changeset: ${UNITY_CHANGESET}" echo "- Platfrom: ${PLATFORM}" echo "- Base: ${BASE_IMAGE}" echo "- Tag: ${DEST_TAG}" @@ -90,11 +95,10 @@ echo "- Image: ${DEST_IMAGE}" docker build \ --platform ${PLATFORM} \ --build-arg "VERSION=${UNITY_VERSION}" \ + --build-arg "CHANGESET=${UNITY_CHANGESET}" \ --build-arg "BASE_IMAGE=${BASE_IMAGE}" \ --build-arg "MODULE=${UNITY_MODULES}" \ - -t ${DEST_IMAGE} \ - ${DOCKER_BUILD_ARGS} \ - . + -t ${DEST_IMAGE} ${DOCKER_BUILD_ARGS} dockerfiles/runner.dockerfile if [ $? -ne 0 ]; then echo "Error: Docker build failed." diff --git a/.github/workflows/create-image.yaml b/.github/workflows/create-image.yaml index 1aaca6d..df1e458 100644 --- a/.github/workflows/create-image.yaml +++ b/.github/workflows/create-image.yaml @@ -1,4 +1,4 @@ -name: Create Images +name: Individual Runners on: workflow_dispatch: @@ -43,7 +43,7 @@ jobs: echo "Unity Version: $VERSION" - name: Docker Build - run: .gitea/workflows/scripts/build-image.sh + run: .gitea/workflows/scripts/build-individual-image.sh id: build-image env: UNITY_VERSION: ${{ env.UNITY_VERSION }} diff --git a/.github/workflows/create-runner.yaml b/.github/workflows/create-runner.yaml new file mode 100644 index 0000000..ced1f11 --- /dev/null +++ b/.github/workflows/create-runner.yaml @@ -0,0 +1,52 @@ +name: 😎 Uber Runner + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - versions.txt + - dockerfiles/runner.dockerfile + - .github/workflows/create-runner.yaml + +jobs: + build-docker: + runs-on: ubuntu-latest + env: + UNITY_MODULES: webgl android ios mac-mono windows-mono linux-il2cpp + + environment: + name: Docker Hub + + name: Build + steps: + - uses: actions/checkout@v4 + + - uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get Unity Version + id: unity-version + run: | + VERSION=$(head -n 1 versions.txt) + echo "UNITY_VERSION=$VERSION" >> $GITHUB_ENV + echo "Unity Version: $VERSION" + + - name: Docker Build + run: .gitea/workflows/scripts/build-runner-image.sh + id: build-image + env: + UNITY_VERSION: ${{ env.UNITY_VERSION }} + UNITY_MODULES: ${{ env.UNITY_MODULES }} + GAMECI_VERSION: ${{ env.GAMECI_VERSION }} + GAMECI_OS: ubuntu + IMAGE: "${{ vars.DOCKERHUB_USERNAME }}/unity-runner" + + - name: Docker Push + run: | + echo "Pushing Docker Image ${{ steps.build-image.outputs.FULL_IMAGE }}" + echo "- Image: ${{ steps.build-image.outputs.IMAGE }}" + echo "- Tag: ${{ steps.build-image.outputs.TAG }}" + docker push ${{ steps.build-image.outputs.FULL_IMAGE }} \ No newline at end of file diff --git a/dockerfiles/individual.dockerfile b/dockerfiles/individual.dockerfile new file mode 100644 index 0000000..fd7f140 --- /dev/null +++ b/dockerfiles/individual.dockerfile @@ -0,0 +1,41 @@ +ARG BASE_IMAGE=unityci/editor + +FROM $BASE_IMAGE +RUN apt-get update && \ + apt-get install -y \ + git \ + curl \ + gcc \ + make \ + libssl-dev \ + zlib1g-dev \ + libsqlite3-dev + +# Set up the scripts +RUN git clone --depth=1 https://github.com/game-ci/unity-builder.git /gameci && \ + cp -rf /gameci/dist/platforms/ubuntu/steps /steps && \ + cp -rf /gameci/dist/default-build-script /UnityBuilderAction && \ + cp /gameci/dist/platforms/ubuntu/entrypoint.sh /entrypoint.sh + +# Set up Node.js environment for github actions +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ + apt-get install -y nodejs && \ + npm install -g npm@latest + +# Install Blender +ARG BLENDER_SHORT_VERSION=3.4 +ARG BLENDER_FULL_VERSION=3.4.1 +RUN echo "BLENDER_FULL_VERSION: $BLENDER_FULL_VERSION" && \ + echo echo "BLENDER_SHORT_VERSION: $BLENDER_SHORT_VERSION" && \ + apt-get install -y wget && \ + wget https://download.blender.org/release/Blender$BLENDER_SHORT_VERSION/blender-$BLENDER_FULL_VERSION-linux-x64.tar.xz && \ + tar -xf blender-$BLENDER_FULL_VERSION-linux-x64.tar.xz && \ + rm blender-$BLENDER_FULL_VERSION-linux-x64.tar.xz +ENV PATH="$PATH:/blender-$BLENDER_FULL_VERSION-linux-x64" + +# Add custom scripts +COPY scripts/build.sh /build.sh +RUN chmod +x /build.sh + +# Done +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/Dockerfile b/dockerfiles/runner.dockerfile similarity index 88% rename from Dockerfile rename to dockerfiles/runner.dockerfile index 645ea18..1c62e0c 100644 --- a/Dockerfile +++ b/dockerfiles/runner.dockerfile @@ -7,10 +7,9 @@ ARG HUB_IMAGE="unityci/hub" FROM $HUB_IMAGE AS builder # Install editor ARG VERSION -ARG CHANGE_SET -RUN unity-hub install --version "$VERSION" --changeset "$CHANGE_SET" | \ - tee /var/log/install-editor.log && grep 'Failed to install\|Error while installing an editor\|Completed with errors' /var/log/install-editor.log | \ - exit $(wc -l) +ARG CHANGESET +RUN unity-hub install --version "$VERSION" --changeset "$CHANGESET" \ + | tee /var/log/install-editor.log && grep 'Failed to install\|Error while installing an editor\|Completed with errors' /var/log/install-editor.log | exit $(wc -l) # Install modules for that editor ARG MODULE="non-existent-module" @@ -35,12 +34,17 @@ RUN echo "$VERSION-$MODULE" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9 || unity-hub install-modules --version "$VERSION" --module "windows-server" --childModules | \ tee /var/log/install-module-windows-server.log && grep 'Missing module' /var/log/install-module-windows-server.log | exit $(wc -l); - - ########################### # Editor # ########################### FROM $BASE_IMAGE + +# Always put "Editor" and "modules.json" directly in $UNITY_PATH +ARG VERSION +ARG MODULE +COPY --from=builder /opt/unity/editors/$VERSION/ "$UNITY_PATH/" +RUN echo $VERSION > "$UNITY_PATH/version" + RUN apt-get update && \ apt-get install -y \ git \ @@ -78,4 +82,4 @@ COPY scripts/build.sh /build.sh RUN chmod +x /build.sh # Done -ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file +# ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file diff --git a/test.sh b/test.sh deleted file mode 100644 index 1091168..0000000 --- a/test.sh +++ /dev/null @@ -1,4 +0,0 @@ -UNITY_VERSION=6000.0.35f1 \ -UNITY_MODULES="webgl linux-server windows-mono mac-mono linux-il2cpp" \ -IMAGE=docker.lakes.house/unityci/editor \ - ./.gitea/workflows/scripts/build-runner-image.sh \ No newline at end of file From 18c299668584d0db4741bc67b87c8ab96a3ccbdd Mon Sep 17 00:00:00 2001 From: Lachee Date: Fri, 19 Sep 2025 17:17:05 +1000 Subject: [PATCH 4/4] updated build scripts --- .gitea/workflows/scripts/build-individual-image.sh | 3 ++- .gitea/workflows/scripts/build-runner-image.sh | 5 +++-- README.md | 3 +++ dockerfiles/runner.dockerfile | 2 +- test.sh | 5 +++++ 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 test.sh diff --git a/.gitea/workflows/scripts/build-individual-image.sh b/.gitea/workflows/scripts/build-individual-image.sh index 1d08962..fdb9226 100644 --- a/.gitea/workflows/scripts/build-individual-image.sh +++ b/.gitea/workflows/scripts/build-individual-image.sh @@ -85,7 +85,8 @@ docker build \ --build-arg BASE_IMAGE=${BASE_IMAGE} \ ${ADDITIONAL_TAGS} \ -t ${FULL_IMAGE} \ - ${DOCKER_BUILD_ARGS} dockerfiles/individual.dockerfile + ${DOCKER_BUILD_ARGS} \ + -f ./dockerfiles/individual.dockerfile . if [ $? -ne 0 ]; then echo "Error: Docker build failed." diff --git a/.gitea/workflows/scripts/build-runner-image.sh b/.gitea/workflows/scripts/build-runner-image.sh index a35d580..c3648a8 100644 --- a/.gitea/workflows/scripts/build-runner-image.sh +++ b/.gitea/workflows/scripts/build-runner-image.sh @@ -92,13 +92,14 @@ echo "- Base: ${BASE_IMAGE}" echo "- Tag: ${DEST_TAG}" echo "- Image: ${DEST_IMAGE}" -docker build \ +docker buildx build \ --platform ${PLATFORM} \ --build-arg "VERSION=${UNITY_VERSION}" \ --build-arg "CHANGESET=${UNITY_CHANGESET}" \ --build-arg "BASE_IMAGE=${BASE_IMAGE}" \ --build-arg "MODULE=${UNITY_MODULES}" \ - -t ${DEST_IMAGE} ${DOCKER_BUILD_ARGS} dockerfiles/runner.dockerfile + -t ${DEST_IMAGE} ${DOCKER_BUILD_ARGS} \ + -f ./dockerfiles/runner.dockerfile . if [ $? -ne 0 ]; then echo "Error: Docker build failed." diff --git a/README.md b/README.md index 4223e2b..9c3db94 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ A table of available Docker images for Unity CI/CD: | 6000.0.35f1 |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-android-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-ios-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-linux-il2cpp-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-mac-mono-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-webgl-runner) |[🐳 View](https://docker.lakes.house/unityci/editor/tag/ubuntu-6000.0.35f1-windows-mono-runner) | +# Usage + + TODO: https://github.com/mob-sakai/unity-changeset/blob/main/src/unityGraphQL.ts diff --git a/dockerfiles/runner.dockerfile b/dockerfiles/runner.dockerfile index 1c62e0c..3cea866 100644 --- a/dockerfiles/runner.dockerfile +++ b/dockerfiles/runner.dockerfile @@ -82,4 +82,4 @@ COPY scripts/build.sh /build.sh RUN chmod +x /build.sh # Done -# ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file +# ENTRYPOINT [ "/bin/bash" ]~ \ No newline at end of file diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..1589d55 --- /dev/null +++ b/test.sh @@ -0,0 +1,5 @@ +UNITY_VERSION=6000.0.35f1 \ +UNITY_CHANGESET="9a3bc604008a" \ +UNITY_MODULES="webgl linux-server windows-mono mac-mono linux-il2cpp" \ +IMAGE=docker.lakes.house/unityci/editor \ + ./.gitea/workflows/scripts/build-runner-image.sh \ No newline at end of file