Change docker script's execution flow

Changes the user who will build the ROM.
Separates building the docker image and building the ROM.
Updates README.md to reflect the new building method.
This commit is contained in:
Lorenzooone 2021-12-27 19:47:19 +01:00 committed by Lorenzo Carletti
parent 7992ee47e3
commit 3412187933
8 changed files with 40 additions and 25 deletions

3
.gitignore vendored
View File

@ -9,6 +9,7 @@
*.ld
Thumbs.db
snapshots/
out/
saves/
working/*.asm
working/*.bin
@ -212,4 +213,4 @@ FakesAssemblies/
*.plg
# Visual Studio 6 workspace options file
*.opt
*.opt

View File

@ -43,5 +43,8 @@ Testing:
John Enigma
CloverCharBoyBound
Docker:
Ds886
Special thanks:
TragicManner

View File

@ -29,7 +29,15 @@ This project aims to both complete the VWF codebase and to provide a tool for tr
## Screenshots
![](./screenshots/itshappening2.png) ![](./screenshots/itshappening4.png) ![](./screenshots/itshappening5.png) ![](./screenshots/m2-status2.png) ![](./screenshots/m2-battle-slugs.png) ![](./screenshots/m2-fileselect.png)
# Building
# Building with Docker
Docker allows easily building without having to install the dependencies.
1. Put a MOTHER 1+2 ROM in `bin/m12fresh.gba`
2. While in the root of the project, run: `docker run --rm -it -v $PWD:/home/m2gba/src lorenzooone/m2gba_translation:builder`
The output will be inside the newly created `out` folder.
# Manually Building
## Dependencies
- [.NET Core 2.1 or later](https://dotnet.microsoft.com/download)
@ -60,7 +68,7 @@ This project aims to both complete the VWF codebase and to provide a tool for tr
2. `dotnet build tools/ScriptToolGui -o bin/ScriptToolGui`
3. Run with `dotnet bin/ScriptToolGui/ScriptToolGui.dll` (or just run the EXE file directly).
# Testing
# Manually Testing
## Dependencies
- [mGBA 0.9.3 or later, or nightly built after Nov 29, 2021](https://mgba.io/downloads.html)

View File

@ -1,12 +0,0 @@
#!/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/m12.gba" for the resulted rom"

View File

@ -1,6 +0,0 @@
#!/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

View File

@ -9,7 +9,6 @@ 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------------------"
RUN git clone --recursive https://github.com/Kingcom/armips.git
WORKDIR /opt/dep/armips
@ -21,7 +20,10 @@ 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
RUN useradd m2gba -m
RUN mkdir -p /home/m2gba/src
RUN cp /root/.dotnet /home/m2gba/.dotnet -R && rm -rf /opt/dep && rm -rf /opt/miscrosoft && rm -rf /root/.dotnet
RUN chown -R m2gba:m2gba /home/m2gba && chown -R m2gba:m2gba /opt/src
WORKDIR /opt/src
CMD ./docker-build-rom-script
USER m2gba
CMD /home/m2gba/src/docker-scripts/docker-build-rom-script

View File

@ -0,0 +1,3 @@
#!/bin/bash
docker rm image mother2gba:build
docker build . -t mother2gba:build

View File

@ -0,0 +1,16 @@
#!/bin/pwsh
$Env:PATH += ":/home/m2gba/.dotnet:/home/m2gba/.dotnet/tools"
Copy-Item -Path "\home\m2gba\src\*" -Destination "\opt\src" -Recurse -Force
"Starting to build tools"
./build-tools.ps1
"Starting to build rom"
./build.ps1
"Copying rom to output"
New-Item -Path "\home\m2gba\src" -Name "out" -ItemType "directory" -Force
Copy-Item -Path ".\bin\m12.gba" "\home\m2gba\src\out"
"Build successful, please review the folder ./out/m12.gba for the resulting rom"