config 2.0 KB

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