config 1.8 KB

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