#############################
#
# Request erp5 development environnment
#
#############################
[buildout]

extends = {{ template_zope }}
parts +=
  request-mariadb
  request-cloudooo
  request-memcached
  request-kumofs
  basedirectory
  erp5-update
  test-runner

eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true

[slap-parameter]
# default site id
site-id = erp5
cloudooo-json =

[test-runner]
recipe = slapos.cookbook:erp5.test
certificate-authority-path = ${test-certificate-authority:ca-dir}
mysql-url = ${request-mariadb:connection-url}
kumofs-url = ${request-kumofs:connection-url}
memcached-url = ${request-memcached:connection-url}
cloudooo-url = ${request-cloudooo:connection-url}
test-instance-path = ${directory:unit-test-path}

prepend-path = ${buildout:bin-directory}
run-unit-test = ${buildout:bin-directory}/runUnitTest
run-test-suite = ${buildout:bin-directory}/runTestSuite

openssl-binary = ${test-certificate-authority:openssl-binary}
run-unit-test-binary = {{ bin_directory }}/runUnitTest
run-test-suite-binary = {{ bin_directory }}/runTestSuite

[test-certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = {{ openssl_location }}/bin/openssl
ca-dir = ${directory:test-ca-dir}
requests-directory = ${test-cadirectory:requests}
wrapper = ${basedirectory:services}/test-ca
ca-private = ${test-cadirectory:private}
ca-certs = ${test-cadirectory:certs}
ca-newcerts = ${test-cadirectory:newcerts}
ca-crl = ${test-cadirectory:crl}

[test-cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = ${directory:test-ca-dir}/requests
private = ${directory:test-ca-dir}/private
certs = ${directory:test-ca-dir}/certs
newcerts = ${directory:test-ca-dir}/newcerts
crl = ${directory:test-ca-dir}/crl

[erp5-update]
recipe = slapos.cookbook:erp5.update

# Configuration
url = http://${zope-instance:user}:${zope-instance:password}@${zope-instance:ip}:${zope-instance:port}/
mysql-url = ${request-mariadb:connection-url}
kumofs-url = ${request-kumofs:connection-url}
memcached-url = ${request-memcached:connection-url}
cloudooo-url = ${request-cloudooo:connection-url}
site-id = ${slap-parameter:site-id}
openssl-binary = {{ openssl_location }}/bin/openssl
cadir-path = ${erp5-certificate-authority:ca-dir}

# Paths
update-wrapper = ${basedirectory:services}/erp5-update

# Defaults
configurator-bt5-list = erp5_full_text_myisam_catalog vifib_configurator
bt5-repository-list = ${zope-instance:bt5-repository-list}

[request-common]
recipe = slapos.cookbook:request
software-url = ${slap-connection:software-release-url}
sla = computer_guid
sla-computer_guid = ${slap-connection:computer-id}
return = url
server-url = ${slap-connection:server-url}
key-file = ${slap-connection:key-file}
cert-file = ${slap-connection:cert-file}
computer-id = ${slap-connection:computer-id}
partition-id = ${slap-connection:partition-id}

[request-mariadb]
<=request-common
name = MariaDB DataBase
software-type = mariadb

[request-cloudooo]
<=request-common
name = Cloudooo
config = cloudooo-json
config-cloudooo-json = ${slap-parameter:cloudooo-json}
software-type = cloudooo

[request-memcached]
<=request-common
name = Memcached
software-type = memcached

[request-kumofs]
<=request-common
name = KumoFS
software-type = kumofs

[directory]
test-ca-dir = ${rootdirectory:srv}/test-ca
test-instance-path = ${rootdirectory:srv}/test-instance
unit-test-path = ${:test-instance-path}/unit_test