diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml new file mode 100644 index 000000000..e3c64859c --- /dev/null +++ b/.github/workflows/ci-docker.yml @@ -0,0 +1,15 @@ +name: Docker Image CI +on: [pull_request, push] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build the Docker image + run: docker build . --file docker/Dockerfile --tag omega:$(date +%s) \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..410757046 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,10 @@ +FROM debian:buster-slim + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi ca-certificates python3 python2.7 && \ + apt-get clean + +COPY ./build / + +ENTRYPOINT ["/build"] \ No newline at end of file diff --git a/docker/build b/docker/build new file mode 100644 index 000000000..e5f0b1510 --- /dev/null +++ b/docker/build @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -e + +REPO="${1:-https://github.com/Omega-Numworks/Omega.git}" +BRANCH="${2:-master}" +MODEL="${3:-MODEL=n0110}" +USERNAME="${4:- }" +OPTIONS="${5:-epsilon_flash}" + +echo Building ${REPO} branch ${BRANCH} for ${MODEL} with options ${OPTIONS} ! + +git clone --recurse-submodules -j $(nproc) --depth 1 --branch ${BRANCH} ${REPO} omega +time make cleanall && time make -j $(nproc) -C omega ${MODEL} ${USERNAME} ${OPTIONS} \ No newline at end of file diff --git a/docker/readme.md b/docker/readme.md new file mode 100644 index 000000000..73485a6d1 --- /dev/null +++ b/docker/readme.md @@ -0,0 +1,22 @@ +# Docker Omega Builder + +This docker build and upload the firmware of a NumWorks from a repo easily. + +## How to use + +Connect the calculator to the computer, then to build the latest official firmware, just run : + +``` +docker run -it --rm --privileged omega/omegaBuilder +``` + +To build a specific version, you can use the following syntax : + +``` +docker run -it --rm --privileged omega/omegaBuilder git-repository-URL git-branch model username make-options +``` + +For example, to build latest dev version : + +``` +docker run -it --rm --privileged omega/omegaBuilder https://github.com/Omega-Numworks/Omega.git omega-dev \ No newline at end of file