[buildout]

# Local development - to be remove
develop =
  ${:parts-directory}/slapos.cookbook-repository

parts=
  slapos-cookbook
  boinc
  condor
  computer-info
  bonjourgrid
  template
  template-boinc
  template-condor
  template-bonjourgrid
  slapos.cookbook-repository
  check-recipe

extends =
  ../../component/boinc-client/buildout.cfg
  ../../component/condor/buildout.cfg
  ../../component/git/buildout.cfg
  ../../stack/slapos.cfg

[template-bonjourgrid]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/bonjourgrid-instance.cfg
output = ${buildout:directory}/template-bonjourgrid.cfg
mode = 0644
md5sum = 4cf5a1a44bc7185f8882ab7247f309fc

[bonjourgrid]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/bonjourgrid.src/bonjourgrid.slapos.tar.gz
md5sum = 5b4594b8451d83eedfa5224dbdcbb872

[template]
# Default template for boinc-client instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 1fad063b948b00be92cbd4d6b1bb8c10
output = ${buildout:directory}/template.cfg
mode = 0644

[computer-info]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/templates/machineinfo.worker.sh.in
md5sum = 994fcb4dff1c86755b27f7c4a085e24a
filename = machineinfo.worker.sh.in
download-only = true

[template-boinc]
# Default template for boinc-client instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/boinc-instance.cfg
md5sum = 0d9da949721c58494fde07ab03684331
output = ${buildout:directory}/template-boinc.cfg
mode = 0644

[template-condor]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/condor-instance.cfg
output = ${buildout:directory}/template-condor.cfg
md5sum = c314c3a338e5f5fa7862cf2ff14bef1b
mode = 0644

# Local development
[slapos.cookbook-repository]
recipe = plone.recipe.command
stop-on-error = true
branch = grid-computing
revision =
location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = "${git:location}/bin/git" clone --branch "${:branch}" --quiet https://lab.nexedi.com/nexedi/slapos.git "${:location}" && if [ -n "${:revision}" ]; then cd "${:location}" && "${git:location}/bin/git" reset --quiet --hard "${:revision}" ; fi
update-command = cd "${:location}" && "${git:location}/bin/git" fetch --quiet && if [ -n "${:revision}" ]; then "${git:location}/bin/git" reset --hard "${:revision}"; else "${git:location}/bin/git" reset --quiet --hard @{upstream} ; fi

[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link
