diff --git a/.gitignore b/.gitignore index fb556eab230..4488b0930f1 100644 --- a/.gitignore +++ b/.gitignore @@ -50,4 +50,3 @@ CMakeFiles/* */*/*/CMakeFiles/* */*/*/*/CMakeFiles/* *.cmake -Makefile diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 00000000000..14018e3fb24 --- /dev/null +++ b/Dockerfile.build @@ -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 + diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..cf8c6f00c1c --- /dev/null +++ b/Makefile @@ -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 \ No newline at end of file diff --git a/MariaDB.repo b/MariaDB.repo new file mode 100644 index 00000000000..a82cfea4d7a --- /dev/null +++ b/MariaDB.repo @@ -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 \ No newline at end of file