From 89d8537d38877ade34e131eed2f43e1c756f0eea Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 23 Sep 2018 13:54:56 +0200 Subject: [PATCH] Add a Dockerfile, simplify the travis script using docker --- .travis.yml | 47 ++++++----------------------------------------- Dockerfile | 6 ++++++ README.md | 16 +++++++++++++++- 3 files changed, 27 insertions(+), 42 deletions(-) create mode 100644 Dockerfile diff --git a/.travis.yml b/.travis.yml index 1353428..f660efd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,52 +1,17 @@ -language: cpp -os: linux -sudo: false -dist: trusty +sudo: required branches: only: - - master -env: - global: - - DEVKITPRO=/opt/devkitpro - - WUT_ROOT=/opt/devkitpro/wut - - DEVKITPPC=/opt/devkitpro/devkitPPC - - PORTLIBREPOS=$HOME/portlibrepos -cache: - directories: - - "$HOME/.local" - - "$DEVKITPRO" + - master +services: +- docker addons: apt: packages: - p7zip-full -before_install: -- mkdir -p "${PORTLIBREPOS}" -- mkdir -p "${DEVKITPRO}" -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb - -O /tmp/devkitpro-pacman.deb; fi -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo dpkg -i /tmp/devkitpro-pacman.deb; - fi -- yes | sudo dkp-pacman -Syu devkitPPC --needed -- yes | sudo dkp-pacman -Syu general-tools --needed -- wget https://github.com/decaf-emu/wut/releases/download/1.0.0-beta/wut.linux64.7z -install: -- 7z x -y $(ls | grep "linux") -o${WUT_ROOT} -- cd $PORTLIBREPOS -- git clone https://github.com/Maschell/WiiUPluginSystem.git -- git clone https://github.com/Maschell/libutils.git -b wut -- cd WiiUPluginSystem -- make && make install -- cd $PORTLIBREPOS -- cd libutils -- mkdir build && cd build -- cmake -DCMAKE_TOOLCHAIN_FILE=$WUT_ROOT/share/wut.toolchain.cmake -DCMAKE_INSTALL_PREFIX=$WUT_ROOT - ../ -- make install -- cd $PORTLIBREPOS before_script: -- cd $TRAVIS_BUILD_DIR/ +- docker build . -t playground-builder script: -- make -j8 +- docker run -it --rm -v ${PWD}:/project playground-builder make before_deploy: - cd $TRAVIS_BUILD_DIR/ - mkdir -p "wiiu/plugins" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb39974 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM wups/core-with-wut:0.1 + +# Get dependencies +COPY --from=wiiuwut/libutils:0.1 /artifacts $WUT_ROOT + +WORKDIR project diff --git a/README.md b/README.md index 3f662dd..0fff5e4 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,18 @@ For building you need: - [libutilswut](https://github.com/Maschell/libutils/tree/wut) (WUT version) for common functions. Some plugins may require more libraries to be installed. Checkout their Makefile for more information. -You could also take a look at the provided travis script and extract the needed building steps. \ No newline at end of file +You could also take a look at the provided travis script and extract the needed building steps. + +### Building using the Dockerfile +It's possible to use a docker image for building. This way you don't need anything installed on your host system. + +``` +# Build docker image (only needed once +docker build . -t playground-builder + +# make +docker run -it --rm -v ${PWD}:/project playground-builder make + +# make clean +docker run -it --rm -v ${PWD}:/project playground-builder make clean +```