config 1.9 KB

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