diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d692d6f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +gameci \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index aa5e3f7..1c46c39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ ARG BASE_IMAGE=unityci/editor FROM $BASE_IMAGE - -# Setup Dependants RUN apt-get update && \ apt-get install -y \ git \ @@ -27,16 +25,17 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ # Install Blender ARG BLENDER_SHORT_VERSION=3.4 ARG BLENDER_FULL_VERSION=3.4.1 - -RUN echo "BLENDER_SHORT_VERSION: $BLENDER_SHORT_VERSION" -RUN echo "BLENDER_FULL_VERSION: $BLENDER_FULL_VERSION" -RUN apt-get update && \ +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/activate.sh /activate.sh +RUN chmod +x /activate.sh + # Done ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/scripts/activate.sh b/scripts/activate.sh new file mode 100644 index 0000000..aa103b6 --- /dev/null +++ b/scripts/activate.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Convert the UNITY_LICENSE to a UNITY_SERIAL +if [ -z "$UNITY_SERIAL" ] && [ ! -z "$UNITY_LICENSE" ]; then + echo "Extracting serial from license file" + UNITY_SERIAL=$(echo "$UNITY_LICENSE" | grep -oP '(?<=/tmp/serial_decoded + UNITY_SERIAL=$(dd if=/tmp/serial_decoded bs=1 skip=4 2>/dev/null) + rm /tmp/serial_decoded +fi +export UNITY_SERIAL="$UNITY_SERIAL" + +# Activate the script. +if [ "$SKIP_ACTIVATION" != "true" ]; then + source /steps/activate.sh + + # If we didn't activate successfully, exit with the exit code from the activation step. + if [[ $UNITY_EXIT_CODE -ne 0 ]]; then + exit $UNITY_EXIT_CODE + fi + + export SKIP_ACTIVATION="true" +else + echo "Skipping activation" +fi \ No newline at end of file