2023-08-28 21:00:35 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2023-09-06 15:17:36 -05:00
|
|
|
# ORG and NAME aren't used unless push is enabled.
|
2023-08-28 21:00:35 -05:00
|
|
|
ORG="askiiart"
|
|
|
|
NAME="discord-always-dungeons"
|
2023-09-06 15:17:36 -05:00
|
|
|
PUSH="false"
|
2023-08-28 21:00:35 -05:00
|
|
|
|
2023-09-05 20:18:17 -05:00
|
|
|
# Apply patch for Docker
|
2023-09-06 15:01:08 -05:00
|
|
|
git apply docker.patch
|
2023-09-06 14:59:21 -05:00
|
|
|
|
|
|
|
# Build image
|
2023-09-06 15:01:08 -05:00
|
|
|
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 *"
|
|
|
|
ID=$(docker build . -q)
|
2023-09-05 20:18:17 -05:00
|
|
|
|
2023-08-28 21:00:35 -05:00
|
|
|
# Could just do -t on the build, but this makes it easier to expand if needed.
|
2023-09-06 15:17:36 -05:00
|
|
|
if [ $ID == "true" ]; then
|
|
|
|
docker tag ${ID} ${ORG}/${NAME}:latest
|
|
|
|
docker push ${ORG}/${NAME}:latest
|
|
|
|
else
|
|
|
|
echo Docker image ID: $ID
|
|
|
|
fi
|