Skip to content

Commit

Permalink
Revert "Simpler build scripts (#1964)"
Browse files Browse the repository at this point in the history
This reverts commit 39a0c9c.
  • Loading branch information
Nick Vyzas authored Mar 20, 2019
1 parent 39a0c9c commit 199b4cb
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 114 deletions.
14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ DEBUG=${ALL_DEBUG}
export MAKE
export CURVER?=2.0.3
export MAKEOPT=-j 4
ifneq (,$(wildcard /etc/os-release))
DISTRO := $(shell gawk -F= '/^NAME/{print $$2}' /etc/os-release)
else
DISTRO := unknown
endif
DISTRO := $(shell gawk -F= '/^NAME/{print $$2}' /etc/os-release)
ifeq ($(wildcard /usr/lib/systemd/system), /usr/lib/systemd/system)
SYSTEMD=1
else
Expand Down Expand Up @@ -377,10 +373,6 @@ ifeq ($(DISTRO),"Ubuntu")
else
ifeq ($(DISTRO),"Debian GNU/Linux")
update-rc.d proxysql defaults
else
ifeq ($(DISTRO),"Unknown")
$(warning Not sure how to install proxysql service on this OS)
endif
endif
endif
endif
Expand Down Expand Up @@ -413,10 +405,6 @@ else
ifeq ($(DISTRO),"Debian GNU/Linux")
if [ -f /etc/init.d/proxysql ]; then rm /etc/init.d/proxysql ; fi
update-rc.d proxysql remove
else
ifeq ($(DISTRO),"Unknown")
$(warning Not sure how to uninstall proxysql service on this OS)
endif
endif
endif
endif
Expand Down
66 changes: 22 additions & 44 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ services:
image: proxysql/packaging:build-centos5
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-centos5
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
centos67_build:
Expand All @@ -44,14 +43,13 @@ services:
image: proxysql/packaging:build-centos6.7
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-centos67
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
centos7_build:
Expand All @@ -71,28 +69,26 @@ services:
image: proxysql/packaging:build-centos7
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-centos7
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
centos7_ch_build:
image: proxysql/packaging:build-centos7
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-centos7
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
fedora24_build:
Expand All @@ -112,28 +108,26 @@ services:
image: proxysql/packaging:build-fedora24
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-fedora24
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
fedora24_ch_build:
image: proxysql/packaging:build-fedora24
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-fedora24
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
fedora27_build:
Expand All @@ -153,28 +147,26 @@ services:
image: proxysql/packaging:build-fedora27
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-fedora27
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
fedora27_ch_build:
image: proxysql/packaging:build-fedora27
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-fedora27
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
fedora28_build:
Expand All @@ -194,28 +186,26 @@ services:
image: proxysql/packaging:build-fedora28
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-fedora28
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
fedora28_ch_build:
image: proxysql/packaging:build-fedora28
volumes:
- ./docker/images/proxysql/rhel-compliant/rpmmacros/:/root/
- ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/rhel-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-fedora28
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
debian7_build:
Expand All @@ -235,14 +225,13 @@ services:
image: proxysql/packaging:build-debian7
volumes:
- ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-debian7
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
debian8_build:
Expand All @@ -262,14 +251,13 @@ services:
image: proxysql/packaging:build-debian8
volumes:
- ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-debian8
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
debian9_build:
Expand All @@ -289,28 +277,26 @@ services:
image: proxysql/packaging:build-debian9
volumes:
- ./docker/images/proxysql/deb-compliant/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-debian9
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
debian9_ch_build:
image: proxysql/packaging:build-debian9
volumes:
- ./docker/images/proxysql/deb-compliant/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-debian9
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
debian9.4_build:
Expand All @@ -330,28 +316,26 @@ services:
image: proxysql/packaging:build-debian9.4
volumes:
- ./docker/images/proxysql/deb-compliant/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-debian9.4
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
debian9.4_ch_build:
image: proxysql/packaging:build-debian9.4
volumes:
- ./docker/images/proxysql/deb-compliant/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-debian9.4
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
ubuntu12_build:
Expand All @@ -371,14 +355,13 @@ services:
image: proxysql/packaging:build-ubuntu12
volumes:
- ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-ubuntu12
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
ubuntu14_build:
Expand All @@ -398,14 +381,13 @@ services:
image: proxysql/packaging:build-ubuntu14
volumes:
- ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-ubuntu14
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
ubuntu16_build:
Expand All @@ -425,28 +407,26 @@ services:
image: proxysql/packaging:build-ubuntu16
volumes:
- ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-ubuntu16
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
ubuntu16_ch_build:
image: proxysql/packaging:build-ubuntu16
volumes:
- ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-ubuntu16
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
ubuntu18_build:
Expand All @@ -466,27 +446,25 @@ services:
image: proxysql/packaging:build-ubuntu18
volumes:
- ./docker/images/proxysql/deb-compliant/bionic-package/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/dbg-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=dbg-ubuntu18
- PROXYSQL_BUILD_TYPE=debug
command:
- /opt/entrypoint/entrypoint.bash
ubuntu18_ch_build:
image: proxysql/packaging:build-ubuntu18
volumes:
- ./docker/images/proxysql/deb-compliant/bionic-package/ctl/:/root/ctl/
- ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
- ./docker/images/proxysql/deb-compliant/ch-entrypoint/:/opt/entrypoint/
- ./:/opt/proxysql/
environment:
- MAKE
- MAKEOPT
- CURVER
- PKG_RELEASE=clickhouse-ubuntu18
- PROXYSQL_BUILD_TYPE=clickhouse
command:
- /opt/entrypoint/entrypoint.bash
18 changes: 18 additions & 0 deletions docker/images/proxysql/deb-compliant/ch-entrypoint/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Delete package if exists
rm -f /opt/proxysql/binaries/proxysql_${CURVER}-${PKG_RELEASE}_amd64.deb || true &&
# Cleanup relic directories from a previously failed build
rm -f /opt/proxysql/proxysql.ctl || true &&
# Clean and build dependancies and source
cd /opt/proxysql && \
${MAKE} cleanbuild && \
${MAKE} ${MAKEOPT} build_deps_clickhouse && \
${MAKE} clickhouse ${MAKEOPT} && \
# Prepare package files and build RPM
cp /root/ctl/proxysql.ctl /opt/proxysql/proxysql.ctl && \
sed -i "s/PKG_VERSION_CURVER/${CURVER}/g" /opt/proxysql/proxysql.ctl && \
cp /opt/proxysql/src/proxysql /opt/proxysql/ && \
equivs-build proxysql.ctl && \
mv /opt/proxysql/proxysql_${CURVER}_amd64.deb ./binaries/proxysql_${CURVER}-${PKG_RELEASE}_amd64.deb && \
# Cleanup current build
rm -f /opt/proxysql/proxysql.ctl /opt/proxysql/proxysql
Loading

0 comments on commit 199b4cb

Please sign in to comment.