Before buildx test

This commit is contained in:
2023-03-25 16:33:13 -07:00
parent 5f5f3c642c
commit 40fd87e4b9
4 changed files with 43 additions and 24 deletions

View File

@@ -2,13 +2,20 @@
ARG IMAGE=unityci/base:latest
FROM ${IMAGE}
ARG SERIAL
ARG USERNAME
ARG PASSWORD
RUN apt update
RUN apt install -y wget chromium-browser
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ADD https://minio.studiowhy.net/hackmd/UnityBuilder /usr/local/bin/
RUN chmod +x /usr/local/bin/UnityBuilder
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
COPY scripts/. /scripts
RUN bash /scripts/activate_license.sh ${SERIAL} ${USERNAME} ${PASSWORD}
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -6,28 +6,10 @@ rm -rf $HOME/.config/unity3d
rm -rf /home/unity/.config/unity3d
#Add ssh key information for resolving packages.
if [[ -n "$SSH_PUBLIC_KEY" && -n "$SSH_PRIVATE_KEY" ]]; then
echo "ADDING SSH KEYS!"
SSH_DIR="/home/$(whoami)/.ssh"
mkdir -p $SSH_DIR
bash /scripts/add_ssh_keys.sh
echo "$SSH_PUBLIC_KEY" > $SSH_DIR/id_rsa.pub
echo "$SSH_PRIVATE_KEY" > $SSH_DIR/id_rsa
cat << EOF > $SSH_DIR/config
Host *
StrictHostKeyChecking no
EOF
chmod 600 $SSH_DIR/id_rsa
chmod 644 $SSH_DIR/id_rsa.pub
cat $SSH_DIR/config
fi
#Activate Unity
if [[ "$SERIAL" == "personal" ]]; then
UnityBuilder activate -i /usr/bin/unity-editor -u $EMAIL -p $PASSWORD
else
unity-editor $DEFAULT_ARGS -serial $SERIAL -username $EMAIL -password $PASSWORD
if [[ "$SERIAL" != "activated" ]]; then
bash /scripts/activate_license.sh "$SERIAL" "$EMAIL" "$PASSWORD"
fi
#Run the command.

View File

@@ -0,0 +1,13 @@
#!/bin/bash
SERIAL=$1; EMAIL=$2; PASSWORD=$3;
if [[ -z "$SERIAL" || -z "$EMAIL" || -z "$PASSWORD" ]]; then
exit 0
fi
#Activate Unity
if [[ "$SERIAL" == "personal" ]]; then
UnityBuilder activate -i /usr/bin/unity-editor -u $EMAIL -p $PASSWORD
else
unity-editor $DEFAULT_ARGS -serial $SERIAL -username $EMAIL -password $PASSWORD
fi

View File

@@ -0,0 +1,17 @@
#!/bin/bash
if [[ -n "$SSH_PUBLIC_KEY" && -n "$SSH_PRIVATE_KEY" ]]; then
echo "ADDING SSH KEYS!"
SSH_DIR="/home/$(whoami)/.ssh"
mkdir -p $SSH_DIR
echo "$SSH_PUBLIC_KEY" > $SSH_DIR/id_rsa.pub
echo "$SSH_PRIVATE_KEY" > $SSH_DIR/id_rsa
cat << EOF > $SSH_DIR/config
Host *
StrictHostKeyChecking no
EOF
chmod 600 $SSH_DIR/id_rsa
chmod 644 $SSH_DIR/id_rsa.pub
cat $SSH_DIR/config
fi