Skip to content

Commit

Permalink
Add docker scripts for ubuntu and fedora
Browse files Browse the repository at this point in the history
  • Loading branch information
layus committed Sep 6, 2018
1 parent 687f3bb commit e0b9b96
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
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 e0b9b96

Please sign in to comment.