Skip to content

Commit

Permalink
Merge pull request #320 from layus/docker-ci
Browse files Browse the repository at this point in the history
Travis CI based on docker
  • Loading branch information
sjmackenzie authored Apr 2, 2022
2 parents aa88bfa + 0b30464 commit b17889a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ jobs:
- make dist VERBOSE=1
- make VERBOSE=1
- make check

- sudo: true
env:
matrix:
- BUILD_FLAVOR=fedora
- BUILD_FLAVOR=ubuntu
before_script: ""
addons:
script: bash ci/$BUILD_FLAVOR.sh

10 changes: 10 additions & 0 deletions ci/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM fedora

RUN yum -y update && \
yum -y install boost-devel tk-devel cmake gcc emacs-nox make gcc-c++ git jre-headless boost-static rpm-build

RUN mkdir -p /usr/src/mozart2/build
WORKDIR /usr/src/mozart2/build

COPY . /usr/src/mozart2

11 changes: 11 additions & 0 deletions ci/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get -qq update && \
apt-get install -y libboost-all-dev emacs tk8.6-dev cmake make openjdk-8-jre 'g++' git dpkg-dev

RUN mkdir -p /usr/src/mozart2/build
WORKDIR /usr/src/mozart2/build

COPY . /usr/src/mozart2

13 changes: 13 additions & 0 deletions ci/fedora.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#/usr/bin/env bash
set -xe

if [ -n "$1" ]; then
cmake -DCPACK_GENERATOR=RPM ..
make -j4 package

cp mozart2-*.rpm /mnt
else
ci=$(realpath ${BASH_SOURCE%/*})
docker build -f $ci/Dockerfile.fedora -t mozart2-fedora $ci/..
docker run -v$ci/..:/mnt -it mozart2-fedora bash ../ci/fedora.sh compile
fi
13 changes: 13 additions & 0 deletions ci/ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#/usr/bin/env bash
set -xe

if [ -n "$1" ]; then
cmake -DCPACK_GENERATOR=DEB ..
make -j4 package

cp mozart2-*.deb /mnt
else
ci=$(dirname $(realpath $BASH_SOURCE))
docker build -f $ci/Dockerfile.ubuntu -t mozart2-ubuntu $ci/..
docker run -v$ci/..:/mnt -it mozart2-ubuntu bash ../ci/ubuntu.sh compile
fi

0 comments on commit b17889a

Please sign in to comment.