As appimage and flatpak use same ubuntu version, merge dockerfiles.

- Use the same structure than xenial dockerfile.
- Do not try to deploy in the docker image as the deployement is made on
  the host.
- Use user `ci_builder` instead of `builder` as it make flatpak fail.
This commit is contained in:
Matthieu Gautier 2019-05-13 10:24:43 +02:00
parent 1ce4c11ec4
commit 6306a4d31b
5 changed files with 54 additions and 158 deletions

View File

@ -30,10 +30,7 @@ jobs:
env: VARIANT=xenial
- stage: build_docker_images
script: *build_images
env: VARIANT=flatpak
- stage: build_docker_images
script: *build_images
env: VARIANT=appimage
env: VARIANT=bionic
- stage: android_build
env: PLATFORM="android"
if: type != pull_request
@ -48,8 +45,8 @@ jobs:
before_install:
- PATH=$PATH:${HOME}/bin:${HOME}/.local/bin
- mkdir -p /tmp/private $HOME/EXPORT/BASE
- chmod -R a+w $HOME/EXPORT
- mkdir -p /tmp/private $HOME/EXPORT/BASE /$HOME/.cache $HOME/.gradle/caches
- chmod -R a+w $HOME/EXPORT $HOME/.cache $HOME/.gradle
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=$PATH:$(brew --prefix)/opt/gettext/bin; fi
- '[ -n "$encrypted_eba2f7543984_iv" ] && openssl aes-256-cbc
-K $encrypted_eba2f7543984_key -iv $encrypted_eba2f7543984_iv
@ -72,8 +69,7 @@ script:
if [[ $TRAVIS_OS_NAME = "linux" ]]
then
VARIANT=xenial
if [[ $PLATFORM = "flatpak" && $DESKTOP_ONLY = 1 ]]; then VARIANT=flatpak; fi
if [[ $PLATFORM = "native_dyn" && $DESKTOP_ONLY = 1 ]]; then VARIANT=appimage; fi
if [[ $DESKTOP_ONLY = 1 ]]; then VARIANT=bionic; fi
fi
- |
if [[ $TRAVIS_OS_NAME = "linux" ]]

View File

@ -1,78 +0,0 @@
FROM ubuntu:bionic
ENV LANG C.UTF-8
RUN \
dpkg --add-architecture i386; \
apt update -q; \
apt full-upgrade --purge -q -y; \
apt install -q -y --no-install-recommends \
# Base build tools
build-essential \
automake \
libtool \
cmake \
ccache \
pkg-config \
autopoint \
patch \
python \
python3 \
python3-pip \
python3-setuptools \
git \
subversion \
wget \
unzip \
sudo \
# Some dependencies already packaged
libbz2-dev \
libmagic-dev \
zlib1g-dev \
uuid-dev \
libmicrohttpd-dev \
aria2 \
# Qt packages
libqt5gui5 \
qtbase5-dev \
qtwebengine5-dev \
libqt5svg5-dev \
qt5-image-formats-plugins \
qt5-default \
# To create the appimage of kiwix-desktop
libfuse2 \
fuse \
patchelf \
# Some helper tools
vim \
less \
grep \
openssh-client \
; \
apt-get clean -y; \
rm -rf \
/usr/share/doc/* \
/var/cache/debconf/*
RUN useradd --create-home travis -G sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER travis
WORKDIR /home/travis
RUN \
mkdir -p /home/travis/.local/bin ;\
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip ;\
unzip ninja-linux.zip ninja ;\
mv ninja /home/travis/.local/bin ;\
rm ninja-linux.zip
ENV PATH="/home/travis/.local/bin:${PATH}"
COPY . kiwix-build/
RUN sudo chown -R travis:travis /home/travis/kiwix-build
RUN pip3 install --user -e kiwix-build
ENV TRAVIS_BUILD_DIR /home/travis/kiwix-build
ENV TRAVIS_OS_NAME linux_artful
CMD kiwix-build/travis/compile_all.py && kiwix-build/travis/deploy.sh

View File

@ -0,0 +1,40 @@
FROM ubuntu:bionic
ENV LANG C.UTF-8
RUN apt update -q
RUN \
apt install -q -y --no-install-recommends \
# Base build tools
build-essential automake libtool cmake ccache pkg-config autopoint patch \
python3-pip python3-setuptools python3-wheel git subversion wget unzip \
ninja-build \
# Packaged dependencies
libbz2-dev libmagic-dev uuid-dev zlib1g-dev \
libmicrohttpd-dev aria2 \
# Qt packages
libqt5gui5 qtbase5-dev qtwebengine5-dev libqt5svg5-dev qt5-image-formats-plugins qt5-default \
# To create the appimage of kiwix-desktop
libfuse2 fuse patchelf \
# Flatpak tools
elfutils flatpak flatpak-builder \
# Other tools (to remove)
# vim less grep \
&& \
apt-get clean -y && \
rm -rf /usr/share/doc/* /var/cache/debconf/*
# Create user
RUN useradd --create-home ci_builder
USER ci_builder
WORKDIR /home/ci_builder
ENV PATH="/home/ci_builder/.local/bin:${PATH}"
# Install kiwix-build
COPY --chown=ci_builder:ci_builder . kiwix-build
RUN pip3 install --user -e ./kiwix-build
ENV TRAVIS_BUILD_DIR /home/ci_builder/kiwix-build
ENV TRAVIS_OS_NAME linux_bionic
CMD kiwix-build/travis/compile_all.py

View File

@ -1,63 +0,0 @@
FROM ubuntu:bionic
ENV LANG C.UTF-8
RUN \
apt update -q; \
apt full-upgrade --purge -q -y; \
apt install -q -y --no-install-recommends \
# Base build tools
build-essential \
automake \
libtool \
cmake \
ccache \
pkg-config \
autopoint \
patch \
python \
python3 \
python3-pip \
python3-setuptools \
git \
subversion \
wget \
unzip \
sudo \
# Flatpak tools
elfutils \
flatpak \
flatpak-builder \
# Some helper tools
vim \
less \
grep \
openssh-client \
; \
apt-get clean -y; \
rm -rf \
/usr/share/doc/* \
/var/cache/debconf/*
RUN useradd --create-home travis -G sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER travis
WORKDIR /home/travis
RUN \
mkdir -p /home/travis/.local/bin ;\
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip ;\
unzip ninja-linux.zip ninja ;\
mv ninja /home/travis/.local/bin ;\
rm ninja-linux.zip
ENV PATH="/home/travis/.local/bin:${PATH}"
COPY . kiwix-build/
RUN sudo chown -R travis:travis /home/travis/kiwix-build
RUN pip3 install --user -e kiwix-build
ENV TRAVIS_BUILD_DIR /home/travis/kiwix-build
ENV TRAVIS_OS_NAME linux_artful
CMD kiwix-build/travis/compile_all.py && kiwix-build/travis/deploy.sh

View File

@ -20,22 +20,23 @@ RUN \
# Cross compile i586
libc6-dev-i386 lib32stdc++6 gcc-multilib g++-multilib \
# Other tools (to remove)
vim less grep && \
# vim less grep \
&& \
apt-get clean -y && \
rm -rf /usr/share/doc/* /var/cache/debconf/*
# Create user
RUN useradd --create-home builder
USER builder
WORKDIR /home/builder
ENV PATH="/home/builder/.local/bin:${PATH}"
RUN useradd --create-home ci_builder
USER ci_builder
WORKDIR /home/ci_builder
ENV PATH="/home/ci_builder/.local/bin:${PATH}"
# Install kiwix-build
COPY --chown=builder:builder . kiwix-build
COPY --chown=ci_builder:ci_builder . kiwix-build
RUN pip3 install --user -e ./kiwix-build
ENV TRAVIS_BUILD_DIR /home/builder/kiwix-build
ENV GRADLE_USER_HOME /home/builder
ENV TRAVIS_OS_NAME linux_xenial
ENV TRAVIS_BUILD_DIR /home/ci_builder/kiwix-build
ENV GRADLE_USER_HOME /home/ci_builder
ENV TRAVIS_OS_NAME linux_xenial
CMD kiwix-build/travis/compile_all.py