config 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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", { step => c("origin_step") }) %]'
  8. arch: '[% pc(c("origin_project"), "var/container/arch", { step => c("origin_step") }) %]'
  9. lsb_release:
  10. id: Debian
  11. codename: jessie
  12. release: 8.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. # Version: 2
  24. # [% c('var/container/suite') %]
  25. set -e
  26. export DEBIAN_FRONTEND=noninteractive
  27. # Update the package cache so the container installs the most recent
  28. # version of required packages.
  29. apt-get update -y -q
  30. [% IF pc(c('origin_project'), 'var/pre_pkginst', { step => c('origin_step') }) -%]
  31. [% pc(c('origin_project'), 'var/pre_pkginst', { step => c('origin_step') }) %]
  32. [% IF c("var/linux-cross") && c("var/container/suite") == "buster" -%]
  33. dpkg --add-architecture [% c("var/arch_debian") %]
  34. [% END -%]
  35. # Update the package cache again because `pre_pkginst` may change the
  36. # package manager configuration.
  37. apt-get update -y -q
  38. [% END -%]
  39. apt-get upgrade -y -q
  40. [%
  41. deps = [];
  42. IF pc(c('origin_project'), 'var/deps', { step => c('origin_step') });
  43. CALL deps.import(pc(c('origin_project'), 'var/deps', { step => c('origin_step') }));
  44. END;
  45. IF pc(c('origin_project'), 'var/arch_deps', { step => c('origin_step') });
  46. CALL deps.import(pc(c('origin_project'), 'var/arch_deps', { step => c('origin_step') }));
  47. END;
  48. IF deps.size;
  49. IF pc(c('origin_project'), 'var/sort_deps', { step => c('origin_step') });
  50. deps = deps.sort;
  51. END;
  52. FOREACH pkg IN deps;
  53. SET p = tmpl(pkg);
  54. IF p;
  55. GET c('install_package', { pkg_name => p });
  56. GET "\n";
  57. END;
  58. END;
  59. END;
  60. -%]
  61. [% IF pc(c('origin_project'), 'var/post_pkginst', { step => c('origin_step') }) -%]
  62. [% pc(c('origin_project'), 'var/post_pkginst', { step => c('origin_step') }) %]
  63. [% END -%]
  64. remote_get: |
  65. #!/bin/sh
  66. set -e
  67. [%
  68. SET src = shell_quote(c('get_src', { error_if_undef => 1 }));
  69. SET dst = shell_quote(c('get_dst', { error_if_undef => 1 }));
  70. -%]
  71. mkdir -p "[% dst %]"
  72. [% c("rbmdir") %]/container archive '[% c("var/container/dir") %]' "[% dst %]/[% c("filename") %]"
  73. input_files:
  74. - project: mmdebstrap-image
  75. target:
  76. - '[% c("var/container/suite") %]-[% c("var/container/arch") %]'