forked from Conjure-Tools/unity-runner
added /activate.sh support
This commit is contained in:
parent
ecb09b074f
commit
12b1f2ca11
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
gameci
|
||||||
13
Dockerfile
13
Dockerfile
@ -1,8 +1,6 @@
|
|||||||
ARG BASE_IMAGE=unityci/editor
|
ARG BASE_IMAGE=unityci/editor
|
||||||
|
|
||||||
FROM $BASE_IMAGE
|
FROM $BASE_IMAGE
|
||||||
|
|
||||||
# Setup Dependants
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
git \
|
git \
|
||||||
@ -27,16 +25,17 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|||||||
# Install Blender
|
# Install Blender
|
||||||
ARG BLENDER_SHORT_VERSION=3.4
|
ARG BLENDER_SHORT_VERSION=3.4
|
||||||
ARG BLENDER_FULL_VERSION=3.4.1
|
ARG BLENDER_FULL_VERSION=3.4.1
|
||||||
|
RUN echo "BLENDER_FULL_VERSION: $BLENDER_FULL_VERSION" && \
|
||||||
RUN echo "BLENDER_SHORT_VERSION: $BLENDER_SHORT_VERSION"
|
echo echo "BLENDER_SHORT_VERSION: $BLENDER_SHORT_VERSION" && \
|
||||||
RUN echo "BLENDER_FULL_VERSION: $BLENDER_FULL_VERSION"
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y wget && \
|
apt-get install -y wget && \
|
||||||
wget https://download.blender.org/release/Blender$BLENDER_SHORT_VERSION/blender-$BLENDER_FULL_VERSION-linux-x64.tar.xz && \
|
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 && \
|
tar -xf blender-$BLENDER_FULL_VERSION-linux-x64.tar.xz && \
|
||||||
rm 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"
|
ENV PATH="$PATH:/blender-$BLENDER_FULL_VERSION-linux-x64"
|
||||||
|
|
||||||
|
# Add custom scripts
|
||||||
|
COPY scripts/activate.sh /activate.sh
|
||||||
|
RUN chmod +x /activate.sh
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||||
29
scripts/activate.sh
Normal file
29
scripts/activate.sh
Normal file
@ -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 '(?<=<DeveloperData Value=")[^"]+' || echo "")
|
||||||
|
if [ ! -z "$UNITY_SERIAL" ]; then
|
||||||
|
echo "Found serial in license file"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$UNITY_SERIAL" | base64 -d >/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
|
||||||
Loading…
x
Reference in New Issue
Block a user