config 1.8 KB

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