Adds an automated docker build

This commit is contained in:
Ds886 2021-12-24 00:50:52 +02:00
parent 009a974a60
commit de513fd714
3 changed files with 47 additions and 0 deletions

28
Dockerfile Normal file
View File

@ -0,0 +1,28 @@
FROM mcr.microsoft.com/powershell:ubuntu-20.04
RUN echo "------------------Updating System------------------"
RUN apt update
RUN apt upgrade
RUN apt install -y wget gcc-arm-none-eabi cmake build-essential tar git
RUN echo "------------------Installing dotnet core------------------"
RUN mkdir -p /opt/dep
WORKDIR /opt/dep
RUN wget https://dot.net/v1/dotnet-install.sh
RUN chmod +x dotnet-install.sh
RUN ./dotnet-install.sh -c 2.1
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN echo "-------------------Installing armips------------------"
WORKDIR /opt/dep
RUN git clone --recursive https://github.com/Kingcom/armips.git
WORKDIR /opt/dep/armips
RUN mkdir -p bld
WORKDIR /opt/dep/armips/bld
RUN cmake ../
RUN make -j
RUN mkdir -p /opt/src/bin
RUN cp /opt/dep/armips/bld/armips /opt/src/bin/armips
RUN cp /opt/dep/armips/bld/armipstests /opt/src/bin/armipstests
RUN cp /opt/dep/armips/bld/libarmips.a /opt/src/bin/libarmips.a
RUN echo "-------------------Building patched rom------------------"
COPY ./ /opt/src
WORKDIR /opt/src
CMD ./docker-build-rom-script

12
docker-build-rom-script Executable file
View File

@ -0,0 +1,12 @@
#!/bin/pwsh
$Env:PATH += ":/root/.dotnet"
echo "Starting to build tools"
./build-tools.ps1
echo "Starting to build rom"
./build.ps1
echo "Copying rom to output"
cp ./bin/m12.gba /opt/out
echo "Build successful please review the folder out for the resulted rom"

7
docker-build.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
rm -rf ./out
mkdir -p ./out
docker rm image mother2gba:build
docker build ./ -t mother2gba:build
docker run --rm -it -v $PWD/out:/opt/out mother2gba:build