config 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. [% IF pc(c('origin_project'), 'var/pre_pkginst') -%]
  18. [% pc(c('origin_project'), 'var/pre_pkginst') %]
  19. [% END -%]
  20. apt-get update -y
  21. apt-get upgrade -y
  22. [%
  23. deps = [];
  24. IF pc(c('origin_project'), 'var/deps');
  25. CALL deps.import(pc(c('origin_project'), 'var/deps'));
  26. END;
  27. IF pc(c('origin_project'), 'var/arch_deps');
  28. CALL deps.import(pc(c('origin_project'), 'var/arch_deps'));
  29. END;
  30. IF deps.size;
  31. IF pc(c('origin_project'), 'var/sort_deps');
  32. deps = deps.sort;
  33. END;
  34. FOREACH pkg IN deps;
  35. SET p = tmpl(pkg);
  36. IF p;
  37. GET c('install_package', { pkg_name => p });
  38. GET "\n";
  39. END;
  40. END;
  41. END;
  42. -%]
  43. [% IF pc(c('origin_project'), 'var/post_pkginst') -%]
  44. [% pc(c('origin_project'), 'var/post_pkginst') %]
  45. [% END -%]
  46. remote_get: |
  47. #!/bin/sh
  48. set -e
  49. [%
  50. SET src = shell_quote(c('get_src', { error_if_undef => 1 }));
  51. SET dst = shell_quote(c('get_dst', { error_if_undef => 1 }));
  52. -%]
  53. mkdir -p "[% dst %]"
  54. sudo tar -C "[% c("var/container/dir") %]/rootfs" -czf "[% dst %]/[% c("filename") %]" .
  55. input_files:
  56. - project: debootstrap-image
  57. target:
  58. - '[% c("var/container/suite") %]-[% c("var/container/arch") %]'