version: "2.0"
services:

####################################################################################################
####################################################################################################
  _build:
    image: none
    network_mode: bridge
    environment:
      - MAKE
      - MAKEOPT
      - CURVER
      - PKG_RELEASE
      - PROXYSQL_BUILD_TYPE
    command: bash -l -c /opt/entrypoint/entrypoint.bash

####################################################################################################
####################################################################################################
  centos6_build:
    extends:
      service: _build
    image: proxysql/packaging:build-centos6
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rhel6/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rhel6/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/rhel6/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=centos6

  centos6_dbg_build:
    extends:
      service: centos6_build
    environment:
      - PKG_RELEASE=dbg-centos6
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  centos7_build:
    extends:
      service: _build
    image: proxysql/packaging:build-centos7
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=centos7

  centos7_dbg_build:
    extends:
      service: centos7_build
    environment:
      - PKG_RELEASE=dbg-centos7
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  centos8_build:
    extends:
      service: _build
    image: proxysql/packaging:build-centos8
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=centos8
      - PROXYSQL_BUILD_TYPE=clickhouse

  centos8_clang_build:
    extends:
      service: centos8_build
    image: proxysql/packaging:build-clang-centos8
    environment:
      - PKG_RELEASE=centos8-clang
      - PROXYSQL_BUILD_TYPE=

  centos8_dbg_build:
    extends:
      service: centos8_build
    environment:
      - PKG_RELEASE=dbg-centos8
      - PROXYSQL_BUILD_TYPE=debug


####################################################################################################
####################################################################################################
  fedora27_build:
    extends:
      service: _build
    image: proxysql/packaging:build-fedora27
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=fedora27
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora27_dbg_build:
    extends:
      service: fedora27_build
    environment:
      - PKG_RELEASE=dbg-fedora27
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  fedora28_build:
    extends:
      service: _build
    image: proxysql/packaging:build-fedora28
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=fedora28
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora28_dbg_build:
    extends:
      service: fedora28_build
    environment:
      - PKG_RELEASE=dbg-fedora28
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  fedora33_build:
    extends:
      service: _build
    image: proxysql/packaging:build-fedora33
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=fedora33
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora33_dbg_build:
    extends:
      service: fedora33_build
    environment:
      - PKG_RELEASE=dbg-fedora33
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  fedora34_build:
    extends:
      service: _build
    image: proxysql/packaging:build-fedora34
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=fedora34
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora34_clang_build:
    extends:
      service: fedora34_build
    image: proxysql/packaging:build-clang-fedora34
    environment:
      - PKG_RELEASE=fedora34-clang
      - PROXYSQL_BUILD_TYPE=

  fedora34_dbg_build:
    image: proxysql/packaging:build-fedora34
    extends:
      service: fedora34_build
    environment:
      - PKG_RELEASE=dbg-fedora34
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  fedora36_build:
    extends:
      service: _build
    image: proxysql/packaging:build-fedora36
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=fedora36
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora36_clang_build:
    extends:
      service: fedora36_build
    image: proxysql/packaging:build-clang-fedora36
    environment:
      - PKG_RELEASE=fedora36-clang
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora36_dbg_build:
    extends:
      service: fedora36_build
    environment:
      - PKG_RELEASE=dbg-fedora36
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  fedora37_build:
    extends:
      service: _build
    image: proxysql/packaging:build-fedora37
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=fedora37
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora37_clang_build:
    extends:
      service: fedora37_build
    image: proxysql/packaging:build-clang-fedora37
    environment:
      - PKG_RELEASE=fedora37-clang
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora37_dbg_build:
    extends:
      service: fedora37_build
    environment:
      - PKG_RELEASE=dbg-fedora37
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  fedora38_build:
    extends:
      service: _build
    image: proxysql/packaging:build-fedora38
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=fedora38
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora38_clang_build:
    extends:
      service: fedora38_build
    image: proxysql/packaging:build-clang-fedora38
    environment:
      - PKG_RELEASE=fedora38-clang
      - PROXYSQL_BUILD_TYPE=clickhouse

  fedora38_dbg_build:
    extends:
      service: fedora38_build
    environment:
      - PKG_RELEASE=dbg-fedora38
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
####################################################################################################
  debian8_build:
    extends:
      service: _build
    image: proxysql/packaging:build-debian8
    volumes:
      - ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=debian8

  debian8_dbg_build:
    extends:
      service: debian8_build
    environment:
      - PKG_RELEASE=dbg-debian8
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  debian9_build:
    extends:
      service: _build
    image: proxysql/packaging:build-debian9
    volumes:
      - ./docker/images/proxysql/deb-compliant/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=debian9

  debian9_dbg_build:
    extends:
      service: debian9_build
    environment:
      - PKG_RELEASE=dbg-debian9
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  debian10_build:
    extends:
      service: _build
    image: proxysql/packaging:build-debian10
    volumes:
      - ./docker/images/proxysql/deb-compliant/latest-package/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=debian10
      - PROXYSQL_BUILD_TYPE=clickhouse

  debian10_dbg_build:
    extends:
      service: debian10_build
    environment:
      - PKG_RELEASE=dbg-debian10
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  debian11_build:
    extends:
      service: _build
    image: proxysql/packaging:build-debian11
    volumes:
      - ./docker/images/proxysql/deb-compliant/latest-package/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=debian11
      - PROXYSQL_BUILD_TYPE=clickhouse

  debian11_clang_build:
    extends:
      service: debian11_build
    image: proxysql/packaging:build-clang-debian11
    environment:
      - PKG_RELEASE=debian11-clang
      - PROXYSQL_BUILD_TYPE=

  debian11_dbg_build:
    extends:
      service: debian11_build
    environment:
      - PKG_RELEASE=dbg-debian11
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  debian12_build:
    extends:
      service: _build
    image: proxysql/packaging:build-debian12
    volumes:
      - ./docker/images/proxysql/deb-compliant/latest-package/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=debian12
      - PROXYSQL_BUILD_TYPE=clickhouse

  debian12_clang_build:
    extends:
      service: debian12_build
    image: proxysql/packaging:build-clang-debian12
    environment:
      - PKG_RELEASE=debian12-clang
      - PROXYSQL_BUILD_TYPE=clickhouse

  debian12_dbg_build:
    extends:
      service: debian12_build
    environment:
      - PKG_RELEASE=dbg-debian12
      - PROXYSQL_BUILD_TYPE=debug


####################################################################################################
####################################################################################################
  ubuntu14_build:
    extends:
      service: _build
    image: proxysql/packaging:build-ubuntu14
    volumes:
      - ./docker/images/proxysql/deb-compliant/pre-systemd/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=ubuntu14

  ubuntu14_dbg_build:
    extends:
      service: ubuntu14_build
    environment:
      - PKG_RELEASE=dbg-ubuntu14
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  ubuntu16_build:
    extends:
      service: _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/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=ubuntu16

  ubuntu16_dbg_build:
    extends:
      service: ubuntu16_build
    environment:
      - PKG_RELEASE=dbg-ubuntu16
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  ubuntu18_build:
    extends:
      service: _build
    image: proxysql/packaging:build-ubuntu18
    volumes:
      - ./docker/images/proxysql/deb-compliant/latest-package/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=ubuntu18
      - PROXYSQL_BUILD_TYPE=clickhouse

  ubuntu18_dbg_build:
    extends:
      service: ubuntu18_build
    environment:
      - PKG_RELEASE=dbg-ubuntu18
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  ubuntu20_build:
    extends:
      service: _build
    image: proxysql/packaging:build-ubuntu20
    volumes:
      - ./docker/images/proxysql/deb-compliant/latest-package/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=ubuntu20
      - PROXYSQL_BUILD_TYPE=clickhouse

  ubuntu20_clang_build:
    extends:
      service: ubuntu20_build
    image: proxysql/packaging:build-clang-ubuntu20
    environment:
      - PKG_RELEASE=ubuntu20-clang
      - PROXYSQL_BUILD_TYPE=

  ubuntu20_dbg_build:
    extends:
      service: ubuntu20_build
    environment:
      - PKG_RELEASE=dbg-ubuntu20
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  ubuntu22_build:
    extends:
      service: _build
    image: proxysql/packaging:build-ubuntu22
    volumes:
      - ./docker/images/proxysql/deb-compliant/latest-package/ctl/:/root/ctl/
      - ./docker/images/proxysql/deb-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=ubuntu22
      - PROXYSQL_BUILD_TYPE=clickhouse

  ubuntu22_clang_build:
    extends:
      service: ubuntu22_build
    image: proxysql/packaging:build-clang-ubuntu22
    environment:
      - PKG_RELEASE=ubuntu22-clang
      - PROXYSQL_BUILD_TYPE=clickhouse

  ubuntu22_dbg_build:
    extends:
      service: ubuntu22_build
    environment:
      - PKG_RELEASE=dbg-ubuntu22
      - PROXYSQL_BUILD_TYPE=debug


####################################################################################################
####################################################################################################
  opensuse15_build:
    extends:
      service: _build
    image: proxysql/packaging:build-opensuse15
    volumes:
      - ./docker/images/proxysql/suse-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/suse-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/suse-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=opensuse15
      - PROXYSQL_BUILD_TYPE=clickhouse

  opensuse15_clang_build:
    extends:
      service: opensuse15_build
    image: proxysql/packaging:build-clang-opensuse15
    environment:
      - PKG_RELEASE=opensuse15-clang
      - PROXYSQL_BUILD_TYPE=

  opensuse15_dbg_build:
    extends:
      service: opensuse15_build
    environment:
      - PKG_RELEASE=dbg-opensuse15
      - PROXYSQL_BUILD_TYPE=debug


####################################################################################################
####################################################################################################
  almalinux8_build:
    extends:
      service: _build
    image: proxysql/packaging:build-almalinux8
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=almalinux8
      - PROXYSQL_BUILD_TYPE=clickhouse

  almalinux8_clang_build:
    extends:
      service: almalinux8_build
    image: proxysql/packaging:build-clang-almalinux8
    environment:
      - PKG_RELEASE=almalinux8-clang
      - PROXYSQL_BUILD_TYPE=

  almalinux8_dbg_build:
    extends:
      service: almalinux8_build
    environment:
      - PKG_RELEASE=dbg-almalinux8
      - PROXYSQL_BUILD_TYPE=debug

####################################################################################################
  almalinux9_build:
    extends:
      service: _build
    image: proxysql/packaging:build-almalinux9
    volumes:
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/rpmbuild/:/root/rpmbuild/
      - ./docker/images/proxysql/rhel-compliant/rpmmacros/.rpmmacros:/root/.rpmmacros
      - ./docker/images/proxysql/rhel-compliant/entrypoint/:/opt/entrypoint/
      - ./:/opt/proxysql/
    environment:
      - PKG_RELEASE=almalinux9
      - PROXYSQL_BUILD_TYPE=clickhouse

  almalinux9_clang_build:
    extends:
      service: almalinux9_build
    image: proxysql/packaging:build-clang-almalinux9
    environment:
      - PKG_RELEASE=almalinux9-clang
      - PROXYSQL_BUILD_TYPE=

  almalinux9_dbg_build:
    extends:
      service: almalinux9_build
    environment:
      - PKG_RELEASE=dbg-almalinux9
      - PROXYSQL_BUILD_TYPE=debug


####################################################################################################
####################################################################################################
