From 5e34e60a97988e5d6a3b816478381e15f1a2f084 Mon Sep 17 00:00:00 2001 From: askiiart Date: Tue, 31 Oct 2023 18:15:57 -0500 Subject: [PATCH] Fix missing rustc --- .drone.yml | 3 ++- Dockerfile | 1 + build.sh | 5 +++-- generate.sh | 0 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 generate.sh diff --git a/.drone.yml b/.drone.yml index 8bde734..d75a57e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,9 +14,10 @@ steps: - apt-get update - apt-get install binutils -y - pip install pyinstaller + - apt update && apt install rustc -y - cd /drone/src && pip install -r requirements.txt && pyinstaller main.py - chmod 777 /drone/src/dist/main/main - - cd /drone/src/dist/main && tar cvfz /drone/src/AlwaysDungeons.tar.gz * + - cd /drone/src/dist/main && tar cvfz /drone/src/AlwaysDungeons.tar.gz * - name: build and publish image: plugins/docker pull: always diff --git a/Dockerfile b/Dockerfile index 889a14a..2d551a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM python:slim-bookworm WORKDIR /data +RUN apt update && apt install -y rust-all ADD AlwaysDungeons.tar.gz /data CMD ["/data/main"] \ No newline at end of file diff --git a/build.sh b/build.sh index 14f19e9..80815e0 100755 --- a/build.sh +++ b/build.sh @@ -5,15 +5,16 @@ ORG="askiiart" NAME="discord-always-dungeons" PUSH="false" + # Apply patch for Docker git apply docker.patch # Build image -docker run -v .:/repo python /bin/sh -c "cd /repo && pip install -r requirements.txt && apt-get update && apt-get install binutils -y && pip install pyinstaller && pyinstaller main.py && cd /repo/dist/main && chmod -R 777 /repo/dist/main && tar cvfz /repo/AlwaysDungeons.tar.gz *" +docker run -v .:/repo python /bin/sh -c "apt update && apt install -y rustc && cd /repo && pip install -r requirements.txt && apt-get update && apt-get install binutils -y && pip install pyinstaller && pyinstaller main.py && cd /repo/dist/main && chmod -R 777 /repo/dist/main && tar cvfz /repo/AlwaysDungeons.tar.gz *" ID=$(docker build . -q) # Could just do -t on the build, but this makes it easier to expand if needed. -if [ $ID == "true" ]; then +if [ $ID == "true" && $PUSH="true" ]; then docker tag ${ID} ${ORG}/${NAME}:latest docker push ${ORG}/${NAME}:latest else diff --git a/generate.sh b/generate.sh new file mode 100644 index 0000000..e69de29