Merge pull request #358 from LeGmask/docker

[Docker] Add docker and docker CI
This commit is contained in:
Quentin
2020-06-23 17:52:42 +02:00
committed by GitHub
4 changed files with 60 additions and 0 deletions

15
.github/workflows/ci-docker.yml vendored Normal file
View File

@@ -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)

10
docker/Dockerfile Normal file
View File

@@ -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"]

13
docker/build Normal file
View File

@@ -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}

22
docker/readme.md Normal file
View File

@@ -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