IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

38 linhas
946B

  1. from .zfs import *
  2. import os
  3. import yaml
  4. def process_step(step, name):
  5. cmd=['jail', '-c']
  6. cmd.append('path=' + '/focker/' + name)
  7. def process_steps(steps, name):
  8. if isinstance(steps, list):
  9. for step in steps:
  10. process_step(step, name)
  11. else:
  12. process_step(steps, name)
  13. def build(spec):
  14. if 'base' not in spec:
  15. raise ValueError('Missing base specification')
  16. base = spec['base']
  17. base = zfs_snapshot_by_tag_or_sha256(base)
  18. root = '/'.join(base.split('/')[:-1])
  19. print('base:', base, 'root:', root)
  20. def command_image_build(args):
  21. fname = os.path.join(args.focker_dir, 'Fockerfile')
  22. print('fname:', fname)
  23. if not os.path.exists(fname):
  24. raise ValueError('No Fockerfile could be found in the specified directory')
  25. with open(fname, 'r') as f:
  26. spec = yaml.safe_load(f)
  27. print('spec:', spec)
  28. build(spec)