config 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # vim: filetype=yaml sw=2
  2. filename: 'container-image_[% c("var/container/suite") %]-[% c("var/container/arch") %]-[% sha256(c("pre")).substr(0, 12) %].tar.gz'
  3. pkg_type: build
  4. var:
  5. container:
  6. use_container: 1
  7. suite: '[% pc(c("origin_project"), "var/container/suite") %]'
  8. arch: '[% pc(c("origin_project"), "var/container/arch") %]'
  9. lsb_release:
  10. id: Debian
  11. codename: wheezy
  12. release: 7.11
  13. pre: |
  14. #!/bin/sh
  15. # [% c('var/container/suite') %]
  16. set -e
  17. export DEBIAN_FRONTEND=noninteractive
  18. [% IF pc(c('origin_project'), 'var/pre_pkginst') -%]
  19. [% pc(c('origin_project'), 'var/pre_pkginst') %]
  20. [% END -%]
  21. apt-get update -y -q
  22. apt-get upgrade -y -q
  23. [%
  24. deps = [];
  25. IF pc(c('origin_project'), 'var/deps');
  26. CALL deps.import(pc(c('origin_project'), 'var/deps'));
  27. END;
  28. IF pc(c('origin_project'), 'var/arch_deps');
  29. CALL deps.import(pc(c('origin_project'), 'var/arch_deps'));
  30. END;
  31. IF deps.size;
  32. IF pc(c('origin_project'), 'var/sort_deps');
  33. deps = deps.sort;
  34. END;
  35. FOREACH pkg IN deps;
  36. SET p = tmpl(pkg);
  37. IF p;
  38. GET c('install_package', { pkg_name => p });
  39. GET "\n";
  40. END;
  41. END;
  42. END;
  43. -%]
  44. [% IF pc(c('origin_project'), 'var/post_pkginst') -%]
  45. [% pc(c('origin_project'), 'var/post_pkginst') %]
  46. [% END -%]
  47. remote_get: |
  48. #!/bin/sh
  49. set -e
  50. [%
  51. SET src = shell_quote(c('get_src', { error_if_undef => 1 }));
  52. SET dst = shell_quote(c('get_dst', { error_if_undef => 1 }));
  53. -%]
  54. mkdir -p "[% dst %]"
  55. sudo tar -C "[% c("var/container/dir") %]/rootfs" -czf "[% dst %]/[% c("filename") %]" .
  56. input_files:
  57. - project: debootstrap-image
  58. target:
  59. - '[% c("var/container/suite") %]-[% c("var/container/arch") %]'