Skip to content
Snippets Groups Projects
Commit aa4fccda authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA
Browse files

Use duniter python image

parent 8589637c
Branches
Tags
No related merge requests found
FROM debian:stretch FROM registry.duniter.org/docker/python3/duniterpy-builder:0.0.7
ARG DEBIAN_FRONTEND=noninteractive
# Install french locales (can be changed but UTF-8 is need)
RUN apt-get update ; apt-get install -y locales
RUN sed -i 's/^# *\(fr_FR.UTF-8\)/\1/' /etc/locale.gen && locale-gen
ENV LANG fr_FR.UTF-8
ENV LANGUAGE fr_FR
ENV LC_ALL fr_FR.UTF-8
# Install basic utils (vim for debug, can be removed) # Install basic utils (vim for debug, can be removed)
RUN apt update ; apt install -y wget curl git vim RUN apt update ; apt install -y wget curl git vim zip
# Install python3 <3
RUN apt update ; apt install -y python3 python3-dev python3-pip build-essential
# Install libs
RUN apt-get -y install libssl-dev libreadline6-dev libbz2-dev
RUN apt-get install -y libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 \
libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev \
libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 \
libxcb-render-util0-dev libxcb-glx0-dev libgl1-mesa-dri libegl1-mesa libpcre3 libgles2-mesa-dev \
freeglut3-dev libfreetype6-dev xorg-dev xserver-xorg-input-void xserver-xorg-video-dummy xpra libosmesa6-dev \
libdbus-1-dev libdbus-glib-1-dev autoconf automake libtool libgstreamer-plugins-base1.0-0 dunst fakeroot \
dbus-x11
# On travis, inso used more up-to-date version
RUN apt-get -y install --no-install-recommends libsodium18 qtbase5-dev
# Needed by lrelease to create translation
RUN apt-get -y install --no-install-recommends qttools5-dev-tools qt5-default
# Install VNC (copied from https://github.com/samgiles/docker-xvfb)
RUN apt-get install -y xvfb x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps
ADD docker/xvfb_init /etc/init.d/xvfb ENV PATH "/opt/qt/5.9/5.9.4/gcc_64/bin:$PYENV_ROOT/bin:$PATH"
RUN chmod a+x /etc/init.d/xvfb ENV PYENV_PYTHON_VERSION 3.5.5
ADD docker/xvfb_daemon_run /usr/bin/xvfb-daemon-run
RUN chmod a+x /usr/bin/xvfb-daemon-run
ENV DISPLAY :99
# Install python dev tools dependencies # Install python dev tools dependencies
RUN pip3 install --upgrade pip ADD docker /docker/
RUN pip3 install coveralls RUN /docker/build_dependencies.sh
RUN pip3 install pytest-cov
RUN pip3 install pyinstaller==3.2
RUN pip3 install dbus-python
RUN pip3 install notify2
# Cache pyqt install (can be removed)
RUN pip3 install "PyQt5>=5.9,<5.10"
RUN mkdir /src
WORKDIR /src/
ADD . /src
# Install python dependencies (for sakia and the dev tools) # Install python dependencies (for sakia and the dev tools)
RUN pip3 install -r requirements.txt ADD requirements.txt /docker
RUN eval "$(pyenv init -)"; \
pyenv shell $PYENV_PYTHON_VERSION; \
pip install -r /docker/requirements.txt
# Utils for building packages # Utils for building packages
RUN apt-get -y install --no-install-recommends zip ADD . /builder/
CMD docker/run.sh CMD "/docker/run.sh"
ENTRYPOINT []
...@@ -6,4 +6,4 @@ services: ...@@ -6,4 +6,4 @@ services:
ports: ports:
- "5699:5699" - "5699:5699"
volumes: volumes:
- ./:/src/ - ./builds/:/builds
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
# Halt on errors # Halt on errors
set -e set -e
echo $PYENV_PYTHON_VERSION
eval "$(pyenv init -)"
pyenv shell $PYENV_PYTHON_VERSION
echo Generation of ressources and translations echo Generation of ressources and translations
python3 gen_resources.py python3 gen_resources.py
python3 gen_translations.py --lrelease python3 gen_translations.py --lrelease
echo pyinstaller
python3 setup.py build
pyinstaller sakia.spec
echo install locally
python3 setup.py install
#! /bin/bash
echo $PYENV_PYTHON_VERSION
eval "$(pyenv init -)"
pyenv shell $PYENV_PYTHON_VERSION
pip install --upgrade pip
pip install coveralls
pip install pytest-cov
pip install pyinstaller==3.2
pip install dbus-python
pip install notify2
# Install python dependencies for sakia
#pip install -r requirements.txt
#!/usr/bin/env bash #!/usr/bin/env bash
rm sakia-linux.zip sakia-linux.deb echo $PYENV_PYTHON_VERSION
eval "$(pyenv init -)"
pyenv shell $PYENV_PYTHON_VERSION
echo pyinstaller
python3 setup.py build
pyinstaller -y sakia.spec
# Cleanup old packages
rm -f sakia-linux.zip sakia-linux.deb
# zip package
zip -r sakia-linux.zip dist/ zip -r sakia-linux.zip dist/
# Debian package # Debian package
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
/etc/init.d/xvfb start /etc/init.d/xvfb start
docker/build.sh /docker/build.sh
pytest --cov=sakia tests /docker/tests.sh
docker/build_package.sh /docker/build_package.sh
#! /bin/bash
echo $PYENV_PYTHON_VERSION
eval "$(pyenv init -)"
pyenv shell $PYENV_PYTHON_VERSION
DISPLAY=:99
/etc/init.d/xvfb start
echo install locally
python3 setup.py install
pytest --cov=sakia tests
#!/bin/bash
export DISPLAY=:99
/etc/init.d/xvfb start
sleep 1
$@
exit_value=$?
/etc/init.d/xvfb stop
exit $exit_value
#! /bin/bash
XVFB=/usr/bin/Xvfb
XVFBARGS="$DISPLAY -ac -screen 0 1024x768x16 +extension RANDR"
PIDFILE=/var/xvfb_${DISPLAY:1}.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
echo -n "Stopping virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --stop --quiet --pidfile $PIDFILE
echo "."
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
exit 1
esac
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment