Skip to content

Commit

Permalink
Merge branch 'buildfile'
Browse files Browse the repository at this point in the history
  • Loading branch information
clinton.begin committed Aug 21, 2017
2 parents 4597593 + 1a3314b commit abf9d4d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ CMakeFiles/*
*/*/*/CMakeFiles/*
*/*/*/*/CMakeFiles/*
*.cmake
Makefile
38 changes: 38 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM centos:7

COPY MariaDB.repo /etc/yum.repos.d/MariaDB.repo

# Install Prerequisites
RUN yum install -y epel-release
RUN yum update -y
RUN yum install -y lsb
RUN yum install -y gcc gcc-c++ ncurses-devel bison flex glibc-devel cmake libgcc perl make libtool \
openssl-devel libaio libaio-devel librabbitmq-devel libcurl-devel pcre-devel rpm-build libedit-devel \
git xz-devel
RUN yum install -y mariadb-server
RUN yum install -y mariadb-devel
RUN git clone https://github.com/cbegin/GPLScale.git

# Install PCRE2
RUN mkdir -p /GPLScale/pcre2/build
WORKDIR /GPLScale/pcre2/build
RUN cmake .. -DCMAKE_C_FLAGS=-fPIC -DBUILD_SHARED_LIBS=N -DPCRE2_BUILD_PCRE2GREP=N -DPCRE2_BUILD_TESTS=N
RUN make
RUN make install

# Install MaxScale
RUN mkdir -p /GPLScale/build
WORKDIR /GPLScale/build
RUN cmake .. -DPACKAGE=Y
RUN make
RUN make install

# Test MaxScale
RUN make testcore

# Package MaxScale
RUN make package
RUN mkdir /packages && \
mv maxscale*.rpm /packages && \
mv maxscale*.tar.gz /packages

15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

all: build dist

build:
docker build -t gplscale -f Dockerfile.build .

dist:
mkdir -p ./build
docker run -v ${shell realpath ./build}:/build gplscale bash -c "cp /packages/* /build"
docker run -v ${shell realpath ./build}:/build gplscale bash -c "cp /etc/maxscale.cnf.template /build"

run:
docker run -ti gplscale bash

.PHONY: all build dist
5 changes: 5 additions & 0 deletions MariaDB.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

0 comments on commit abf9d4d

Please sign in to comment.