Skip to content

Commit

Permalink
Merge pull request godotengine#388 from rcorre/docker
Browse files Browse the repository at this point in the history
Add a Dockerfile for local reference updates.
  • Loading branch information
Jason0214 committed Jan 5, 2021
2 parents cc0478a + 47cca0e commit be76c4e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:xenial

ENV BLENDER_VERSION 2.81

RUN apt-get update
RUN apt-get install --no-install-recommends -y \
libsdl1.2debian \
libglu1 python3-pip \
bash \
wget \
bzip2 \
make \
libxi6 \
libxrender1
RUN pip3 install --upgrade pip
RUN pip3 install --upgrade setuptools

COPY requirements.txt .
RUN pip3 install -r requirements.txt

COPY tests/install_blender.sh .

RUN bash install_blender.sh ${BLENDER_VERSION}

VOLUME /workdir
WORKDIR /workdir

ENTRYPOINT ["tests/entrypoint.sh"]
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ test-import: export-blends


update-examples:
mkdir -p tests/reference_exports
find tests/godot_project/exports/ -name *.escn | while read f; \
do \
mkdir -p "tests/reference_exports/$$(echo $$f | cut -d/ -f4)"; \
cp "$$f" "tests/reference_exports/$$(echo $$f | cut -d/ -f4-)"; \
done;
rm -r tests/reference_exports/*
cp -r tests/godot_project/exports/* tests/reference_exports/

compare: export-blends
diff -x "*.escn.import" -rq tests/godot_project/exports/ tests/reference_exports/
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ diff test failure:
- You can run a `make export-blends` followed by a `make update-examples` and commit the changes made to the [reference_exports](tests/reference_exports). However, if you are running on a platform different than the one used by the TravisCI, there is a small chance that regression won't be passing because of float rounding. Then you might need to look at the TravisCI log and fix the remaining issue by hand.
- Or you can use the [update_scene_from_travis.sh](tests/update_scene_from_travis.sh) script, run it with the failing TravisCI job ID as the argument. The script will fetch the scene diffs from the Travis machine to your local git repository and apply it.

## Docker

The reference exports depend on a very specific version of Blender, and may
produce different results with your local blender version. A Dockerfile is
provided to help test and update examples:

To build:
```
sudo docker build . -t godot_blender_exporter:latest
```

To test:
```
docker run --volume .:/tests/reference_exports godot_blender_exporter:latest compare
```

To update reference exports:
```
docker run --volume .:/tests/reference_exports godot_blender_exporter:latest export-blends update-examples
```

## License

This Godot exporter is distributed under the terms of the GNU General
Expand Down
4 changes: 4 additions & 0 deletions tests/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

. ../.envs # generated by install_blender.sh
make BLENDER=${BLENDER_BIN} PYLINT='python3 -m pylint' $@

0 comments on commit be76c4e

Please sign in to comment.