add fedora docker image to travis compilation (#3447)
* add fedora docker image to travis compilation fixes #1746 * add dockerfile * would you like to please install for me? [y/n] * remove bc dependency * save cache separately for different docker builds * add development packages to fedora dockerfile * add package names * use env values to make these all look the same * set docker image name correctly * add missing dependency * minor oversight, add %% to remove all braces in check schema
This commit is contained in:
parent
06081bd940
commit
f1563c5604
4 changed files with 81 additions and 24 deletions
17
.ci/Fedora29/Dockerfile
Normal file
17
.ci/Fedora29/Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
|||
FROM fedora:29
|
||||
|
||||
RUN dnf install -y \
|
||||
@development-tools \
|
||||
ccache \
|
||||
cmake \
|
||||
desktop-file-utils \
|
||||
file \
|
||||
gcc-c++ \
|
||||
hicolor-icon-theme \
|
||||
libappstream-glib \
|
||||
protobuf-devel \
|
||||
qt5-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \
|
||||
sqlite-devel \
|
||||
wget \
|
||||
zlib-devel \
|
||||
&& dnf clean all
|
|
@ -1,7 +1,6 @@
|
|||
FROM ubuntu:bionic
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
bc \
|
||||
build-essential \
|
||||
clang-format \
|
||||
file \
|
||||
|
|
79
.travis.yml
79
.travis.yml
|
@ -1,33 +1,15 @@
|
|||
language: cpp
|
||||
compiler: gcc
|
||||
cache: ccache
|
||||
|
||||
matrix:
|
||||
include:
|
||||
#Ubuntu Bionic (on docker)
|
||||
- name: Ubuntu Bionic (Debug)
|
||||
if: tag IS NOT present
|
||||
services: docker
|
||||
before_install: docker build -t img .ci/UbuntuBionic
|
||||
script: docker run --mount "type=bind,source=$(pwd),target=/src" -w="/src"
|
||||
--mount "type=bind,source=$HOME/.ccache,target=/.ccache" -e "CCACHE_DIR=/.ccache"
|
||||
img
|
||||
bash .ci/travis-compile.sh --server --debug
|
||||
- name: Ubuntu Bionic (Release)
|
||||
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
||||
services: docker
|
||||
before_install: docker build -t img .ci/UbuntuBionic
|
||||
script: docker run --mount "type=bind,source=$(pwd),target=/src" -w="/src"
|
||||
--mount "type=bind,source=$HOME/.ccache,target=/.ccache" -e "CCACHE_DIR=/.ccache"
|
||||
img
|
||||
bash .ci/travis-compile.sh --server --package "Ubuntu18.04" --release
|
||||
|
||||
#Ubuntu Xenial (Debug only)
|
||||
- name: Ubuntu Xenial (Debug)
|
||||
if: tag IS NOT present
|
||||
os: linux
|
||||
dist: xenial
|
||||
group: stable
|
||||
cache: ccache
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
|
@ -43,27 +25,84 @@ matrix:
|
|||
- libqt5websockets5-dev
|
||||
script: bash ./.ci/travis-compile.sh --format --server --test --debug
|
||||
|
||||
#Ubuntu Bionic (on docker)
|
||||
- name: Ubuntu Bionic (Debug)
|
||||
if: tag IS NOT present
|
||||
services: docker
|
||||
env: NAME=UbuntuBionic
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/$NAME/
|
||||
before_install: docker build -t "cockatrice_${NAME,,}" .ci/$NAME && mkdir -p $HOME/$NAME/.ccache
|
||||
script: docker run --mount "type=bind,source=$(pwd),target=/src" -w="/src"
|
||||
--mount "type=bind,source=$HOME/$NAME/.ccache,target=/.ccache" -e "CCACHE_DIR=/.ccache"
|
||||
"cockatrice_${NAME,,}"
|
||||
bash .ci/travis-compile.sh --server --debug
|
||||
|
||||
- name: Ubuntu Bionic (Release)
|
||||
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
||||
services: docker
|
||||
env: NAME=UbuntuBionic
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/$NAME/
|
||||
before_install: docker build -t "cockatrice_${NAME,,}" .ci/$NAME && mkdir -p $HOME/$NAME/.ccache
|
||||
script: docker run --mount "type=bind,source=$(pwd),target=/src" -w="/src"
|
||||
--mount "type=bind,source=$HOME/$NAME/.ccache,target=/.ccache" -e "CCACHE_DIR=/.ccache"
|
||||
"cockatrice_${NAME,,}"
|
||||
bash .ci/travis-compile.sh --server --package "$NAME" --release
|
||||
|
||||
#Fedora 29 (on docker)
|
||||
- name: Fedora 29 (Debug)
|
||||
if: tag IS NOT present
|
||||
services: docker
|
||||
env: NAME=Fedora29
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/$NAME/
|
||||
before_install: docker build -t "cockatrice_${NAME,,}" .ci/$NAME && mkdir -p $HOME/$NAME/.ccache
|
||||
script: docker run --mount "type=bind,source=$(pwd),target=/src" -w="/src"
|
||||
--mount "type=bind,source=$HOME/$NAME/.ccache,target=/.ccache" -e "CCACHE_DIR=/.ccache"
|
||||
"cockatrice_${NAME,,}"
|
||||
bash .ci/travis-compile.sh --server --debug
|
||||
|
||||
- name: Fedora 29 (Release)
|
||||
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
||||
services: docker
|
||||
env: NAME=Fedora29
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/$NAME/
|
||||
before_install: docker build -t "cockatrice_${NAME,,}" .ci/$NAME && mkdir -p $HOME/$NAME/.ccache
|
||||
script: docker run --mount "type=bind,source=$(pwd),target=/src" -w="/src"
|
||||
--mount "type=bind,source=$HOME/$NAME/.ccache,target=/.ccache" -e "CCACHE_DIR=/.ccache"
|
||||
"cockatrice_${NAME,,}"
|
||||
bash .ci/travis-compile.sh --server --package "$NAME" --release
|
||||
|
||||
#macOS
|
||||
- name: macOS (Debug)
|
||||
if: tag IS NOT present
|
||||
os: osx
|
||||
osx_image: xcode8
|
||||
cache: ccache
|
||||
before_install:
|
||||
- brew update
|
||||
- brew install ccache
|
||||
- brew install protobuf --without-python@2
|
||||
- brew install qt
|
||||
script: bash ./.ci/travis-compile.sh --server --install --debug
|
||||
|
||||
- name: macOS (Release)
|
||||
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
||||
os: osx
|
||||
osx_image: xcode8
|
||||
cache: ccache
|
||||
before_install:
|
||||
- brew update
|
||||
- brew install ccache
|
||||
- brew install protobuf --without-python@2
|
||||
- brew install qt
|
||||
script: bash ./.ci/travis-compile.sh --server --package "" --release
|
||||
script: bash ./.ci/travis-compile.sh --server --package "$TRAVIS_OS_NAME" --release
|
||||
|
||||
|
||||
# Builds for pull requests skip the deployment step altogether
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
|
||||
set -e
|
||||
|
||||
schema_ver="$(grep 'INSERT INTO cockatrice_schema_version' servatrice/servatrice.sql | sed 's/.*VALUES(//' | sed 's/).*//')"
|
||||
version_line="$(grep 'INSERT INTO cockatrice_schema_version' servatrice/servatrice.sql)"
|
||||
version_line="${version_line#*VALUES(}"
|
||||
declare -i schema_ver="${version_line%%)*}"
|
||||
|
||||
latest_migration="$(ls -1 servatrice/migrations/ | tail -n1)"
|
||||
xtoysql="${latest_migration#servatrice_}"
|
||||
xtoy="${xtoysql%.sql}"
|
||||
old_ver="$(echo ${xtoy%%_to_*} | bc)"
|
||||
new_ver="$(echo ${xtoy##*_to_} | bc)"
|
||||
declare -i old_ver="10#${xtoy%_to_*}" #declare as integer with base 10, numbers with a leading 0 are normally interpreted as base 16
|
||||
declare -i new_ver="10#${xtoy#*_to_}"
|
||||
|
||||
if ((old_ver >= new_ver)); then
|
||||
echo "New version $new_ver is not newer than $old_ver"
|
||||
|
|
Loading…
Reference in a new issue