rbm.conf 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. # vim: filetype=yaml sw=2
  2. debug: '[% GET ! ENV.RBM_NO_DEBUG %]'
  3. compress_tar: gz
  4. output_dir: "out/[% project %]"
  5. tmp_dir: '[% c("basedir") %]/tmp'
  6. build_log: '[% GET ENV.RBM_LOGS_DIR ? ENV.RBM_LOGS_DIR : "logs" %]/[% project %][% IF c("var/osname") %]-[% c("var/osname") %][% END %].log'
  7. pkg_type: build
  8. steps:
  9. src-tarballs:
  10. compress_tar: xz
  11. src-tarballs: |
  12. #!/bin/bash
  13. set -e
  14. mkdir -p '[% dest_dir %]'
  15. mv -vf '[% project %]-[% c("version") %].tar.xz' '[% dest_dir %]/[% c("filename") %]'
  16. list_toolchain_updates:
  17. build_log: '-'
  18. list_toolchain_updates: '[% INCLUDE list_toolchain_updates %]'
  19. cargo_vendor:
  20. output_dir: "out/[% project %]/cargo_vendor"
  21. var:
  22. container:
  23. suite: bullseye
  24. arch: amd64
  25. pre_pkginst: ''
  26. deps:
  27. - cargo
  28. - patch
  29. - bzip2
  30. cargo_vendor: |
  31. #!/bin/bash
  32. [% c("var/set_default_env") %]
  33. tar -xf [% project %]-[% c('version') %].tar.gz
  34. cd [% project %]-[% c('version') %]
  35. [% c("var/pre_cargo_vendor") %]
  36. cargo vendor vendor [% c("var/cargo_vendor_opts") %]
  37. [% c('tar', {
  38. tar_src => [ 'vendor' ],
  39. tar_args => '-caf ' _ dest_dir _ '/' _ c('filename'),
  40. }) %]
  41. cd [% dest_dir %]
  42. fname="out/[% project %]/cargo_vendor/[% c('filename') %]"
  43. echo
  44. echo "Finished creating $fname"
  45. sha256sum "[% c('filename') %]"
  46. echo "You can upload it with:"
  47. echo " scp -p $fname people.torproject.org:public_html/mirrors/sources"
  48. # buildconf contains build options that the user can change in rbm.local.conf
  49. # When adding a new option to buildconf, a default value should be defined
  50. # in var/build_id, so that changing this option does not affect the build_id.
  51. buildconf:
  52. num_procs: '[% GET ENV.RBM_NUM_PROCS ? ENV.RBM_NUM_PROCS : "4" %]'
  53. git_signtag_opt: '-s'
  54. var:
  55. torbrowser_version: '11.5a1'
  56. torbrowser_build: 'build2'
  57. torbrowser_incremental_from:
  58. - 11.0a10
  59. project_name: tor-browser
  60. multi_lingual: 0
  61. build_mar: 1
  62. # By default, we sort the list of installed packages. This allows sharing
  63. # containers with identical list of packages, even if they are not listed
  64. # in the same order. In the cases where the installation order is
  65. # important, sort_deps should be set to 0.
  66. sort_deps: 1
  67. build_id: '[% sha256(c("var/build_id_txt", { buildconf => { num_procs => 4 } })).substr(0, 6) %]'
  68. build_id_txt: |
  69. [% c("version") %]
  70. [% IF c("git_hash") || c("hg_hash"); GET c("abbrev"); END; %]
  71. [% IF c("var/container/use_container") && ! c("var/container/global_disable") -%]
  72. [% c("var/container/suite") %]
  73. [% c("var/container/arch") %]
  74. [% END -%]
  75. input_files: [% c("input_files_id") %]
  76. build:
  77. [% SET step = c("step") -%]
  78. [% c(step, { filename => 'f', output_dir => '/out', norec => {} }) %]
  79. container:
  80. dir: '[% c("rbm_tmp_dir") %]/rbm-containers/[% sha256(c("build_id")) %]'
  81. user: rbm
  82. disable_network:
  83. # disable network in the build scripts
  84. build: 1
  85. input_files_list: |
  86. [% FOREACH file IN c("input_files_by_name").keys.sort -%]
  87. [% c("input_files_by_name/" _ file) %]
  88. [% END -%]
  89. faketime: "faketime -f \"[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]\""
  90. touch: "[% USE date %]touch -m -t [% date.format(c('timestamp'), format = '%Y%m%d%H%M') %]"
  91. locale_ja: ja
  92. locales:
  93. - ar
  94. - ca
  95. - cs
  96. - da
  97. - de
  98. - el
  99. - es-AR
  100. - es-ES
  101. - fa
  102. - fr
  103. - ga-IE
  104. - he
  105. - hu
  106. - id
  107. - is
  108. - it
  109. - '[% c("var/locale_ja") %]'
  110. - ka
  111. - ko
  112. - lt
  113. - mk
  114. - ms
  115. - my
  116. - nb-NO
  117. - nl
  118. - pl
  119. - pt-BR
  120. - ro
  121. - ru
  122. - sv-SE
  123. - th
  124. - tr
  125. - vi
  126. - zh-CN
  127. - zh-TW
  128. locales_mobile:
  129. - ar
  130. - ca
  131. - cs
  132. - da
  133. - de
  134. - el
  135. - es-rAR
  136. - es-rES
  137. - fa
  138. - fr
  139. - ga-rIE
  140. - hu
  141. - in
  142. - is
  143. - it
  144. - iw
  145. - ja
  146. - ka
  147. - ko
  148. - lt
  149. - my
  150. - nb-rNO
  151. - nl
  152. - pl
  153. - pt-rBR
  154. - ro
  155. - ru
  156. - sv-rSE
  157. - th
  158. - tr
  159. - vi
  160. - zh-rCN
  161. - zh-rTW
  162. sign_build: '[% ENV.RBM_SIGN_BUILD %]'
  163. sign_build_gpg_opts: '[% ENV.RBM_GPG_OPTS %]'
  164. rezip: |
  165. rezip_tmpdir=$(mktemp -d)
  166. mkdir -p "$rezip_tmpdir/z"
  167. unzip -d "$rezip_tmpdir/z" -- [% c("rezip_file") %] || [ $? -lt 3 ]
  168. pushd "$rezip_tmpdir/z"
  169. [% c("zip", {
  170. zip_src => [ '.' ],
  171. zip_args => '$rezip_tmpdir/new.zip',
  172. }) %]
  173. popd
  174. mv -f -- "$rezip_tmpdir/new.zip" [% c("rezip_file") %]
  175. rm -Rf "$rezip_tmpdir"
  176. set_default_env: |
  177. set -e
  178. [% FOREACH env = c('ENV') -%]
  179. export [% env.key %]="[% env.value %]"
  180. [% END -%]
  181. rootdir=$(pwd)
  182. export SHELL=/bin/bash
  183. export HOME=$rootdir
  184. umask 0022
  185. [% IF c("var/container/global_disable") -%]
  186. rm -Rf /var/tmp/build /var/tmp/dist
  187. [% END -%]
  188. DOCSDIR_project: '[% project %]'
  189. set_PTDIR_DOCSDIR: |
  190. PTDIR="$distdir/TorBrowser/Tor/PluggableTransports"
  191. DOCSDIR="$distdir/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
  192. targets:
  193. notarget: linux-x86_64
  194. noint:
  195. debug: 0
  196. release:
  197. var:
  198. release: 1
  199. channel: release
  200. alpha:
  201. var:
  202. alpha: 1
  203. channel: alpha
  204. nightly:
  205. fetch: 1
  206. var:
  207. nightly: 1
  208. channel: nightly
  209. torbrowser_version: |
  210. [%
  211. IF ENV.TORBROWSER_NIGHTLY_VERSION;
  212. GET ENV.TORBROWSER_NIGHTLY_VERSION;
  213. ELSIF c("var/testbuild");
  214. GET "testbuild";
  215. ELSE;
  216. GET c("var_p/nightly_torbrowser_version");
  217. END;
  218. -%]
  219. # For nightly builds, we support updates for a limited set of locales
  220. mar_locales:
  221. - de
  222. - es-ES
  223. - fr
  224. - ru
  225. max_torbrowser_incremental_from: 2
  226. build_infos_json: 1
  227. torbrowser-testbuild:
  228. - testbuild
  229. - alpha
  230. testbuild:
  231. var:
  232. testbuild: 1
  233. # Don't create mar files to save time
  234. build_mar: 0
  235. torbrowser-android-armv7:
  236. - android-armv7
  237. - android
  238. android-armv7:
  239. arch: armv7
  240. var:
  241. android-armv7: 1
  242. osname: android-armv7
  243. toolchain_arch: arm
  244. abi: armeabi-v7a
  245. cross_prefix: armv7a-linux-androideabi
  246. torbrowser-android-x86:
  247. - android-x86
  248. - android
  249. android-x86:
  250. arch: x86
  251. var:
  252. android-x86: 1
  253. osname: android-x86
  254. toolchain_arch: x86
  255. abi: x86
  256. cross_prefix: i686-linux-android
  257. torbrowser-android-x86_64:
  258. - android-x86_64
  259. - android
  260. android-x86_64:
  261. arch: x86_64
  262. var:
  263. android-x86_64: 1
  264. osname: android-x86_64
  265. toolchain_arch: x86_64
  266. abi: x86_64
  267. cross_prefix: x86_64-linux-android
  268. torbrowser-android-aarch64:
  269. - android-aarch64
  270. - android
  271. android-aarch64:
  272. arch: aarch64
  273. var:
  274. android-aarch64: 1
  275. osname: android-aarch64
  276. toolchain_arch: arm64
  277. abi: arm64-v8a
  278. cross_prefix: aarch64-linux-android
  279. android:
  280. var:
  281. android: 1
  282. compiler: android-toolchain
  283. android_min_api: '[% GET c("var/android_min_api_" _ c("arch")) %]'
  284. CC: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  285. CXX: '[% c("var/cross_prefix") %][% c("var/android_min_api") %]-clang'
  286. # API 16 is the minimum we currently support for 32 bit on Android
  287. android_min_api_armv7: 16
  288. android_min_api_x86: 16
  289. # API 21 is the minimum we currently support for 64 bit on Android
  290. android_min_api_x86_64: 21
  291. android_min_api_aarch64: 21
  292. container:
  293. suite: bullseye
  294. arch: amd64
  295. disable_network:
  296. # Disable network in the script for merging GeckoView .aar files
  297. merge_aars: 1
  298. deps:
  299. - build-essential
  300. - python3
  301. - python3-distutils
  302. - automake
  303. - libtool
  304. - zip
  305. - unzip
  306. - libtinfo5
  307. configure_opt: '--host=[% c("var/cross_prefix") %] CC=[% c("var/CC") %] [% c("var/configure_opt_project") %]'
  308. pre_pkginst: |
  309. SNAPSHOT_VERSION=20191201T212855Z
  310. OPENJDK_URL=https://snapshot.debian.org/archive/debian/$SNAPSHOT_VERSION/pool/main/o/openjdk-8
  311. JDK_VERSION=8u232-b09-1~deb9u1_amd64
  312. apt-get install -y -q wget ca-certificates-java
  313. wget $OPENJDK_URL/openjdk-8-jdk-headless_$JDK_VERSION.deb
  314. wget $OPENJDK_URL/openjdk-8-jre-headless_$JDK_VERSION.deb
  315. echo 92b4f8fb77d793a86e0b03b3b0750592b40a26a5d75956d10dd984a7b3aad4c9 openjdk-8-jdk-headless_$JDK_VERSION.deb | sha256sum -c
  316. echo 84bf52b6cce20ead08b0d5b9fd9b81b4aa3da385ca951b313fe11d5cb1aa4d17 openjdk-8-jre-headless_$JDK_VERSION.deb | sha256sum -c
  317. apt-get install -y -q ./openjdk-8-jre-headless_$JDK_VERSION.deb ./openjdk-8-jdk-headless_$JDK_VERSION.deb
  318. torbrowser-linux-x86_64:
  319. - linux-x86_64
  320. - linux
  321. torbrowser-linux-x86_64-asan:
  322. - linux-asan
  323. - linux-x86_64
  324. - linux
  325. torbrowser-linux-i686:
  326. - linux-i686
  327. - linux
  328. torbrowser-linux-arm:
  329. - linux-arm
  330. - linux-cross
  331. - linux
  332. linux-x86_64:
  333. arch: x86_64
  334. var:
  335. linux-x86_64: 1
  336. osname: linux-x86_64
  337. linux-cross: 0
  338. arch_debian: amd64
  339. # We only support RLBox on the nightly channel and x86_64 for now
  340. rlbox: 0
  341. linux-i686:
  342. arch: i686
  343. var:
  344. linux-i686: 1
  345. osname: linux-i686
  346. linux-cross: 0
  347. configure_opt: '--host=i686-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 [% c("var/configure_opt_project") %]'
  348. arch_debian: i386
  349. linux-arm:
  350. arch: arm
  351. var:
  352. linux-arm: 1
  353. osname: linux-arm
  354. crosstarget: arm-linux-gnueabihf
  355. configure_opt: '--host=arm-linux-gnueabihf [% c("var/configure_opt_project") %]'
  356. arch_debian: armhf
  357. linux-cross:
  358. var:
  359. linux-cross: 1
  360. container:
  361. arch: amd64
  362. linux:
  363. var:
  364. linux: 1
  365. compiler: gcc
  366. configure_opt: '[% c("var/configure_opt_project") %]'
  367. # Only build Namecoin for linux on nightly
  368. namecoin: '[% c("var/nightly") %]'
  369. container:
  370. suite: jessie
  371. arch: amd64
  372. pre_pkginst: dpkg --add-architecture i386
  373. deps:
  374. - libc6-dev-i386
  375. - lib32stdc++6
  376. - build-essential
  377. - python
  378. - bison
  379. - hardening-wrapper
  380. - automake
  381. - libtool
  382. - zip
  383. - unzip
  384. linux-asan:
  385. var:
  386. asan: 1
  387. # RLBox needs clang to create .wasm files but we use mostly GCC for our
  388. # ASan builds. Thus, the compilation currently breaks with RLBox enabled.
  389. # See: tor-browser-build#40063.
  390. rlbox: 0
  391. torbrowser-windows-i686:
  392. - windows-i686
  393. - windows
  394. torbrowser-windows-x86_64:
  395. - windows-x86_64
  396. - windows
  397. windows-x86_64:
  398. arch: x86_64
  399. var:
  400. windows-x86_64: 1
  401. windows-i686: 0
  402. osname: windows-x86_64
  403. # HEASLR is 64 bit only (see bug 12968)
  404. flag_HEASLR: '-Wl,--high-entropy-va'
  405. windows-i686:
  406. arch: i686
  407. var:
  408. windows-i686: 1
  409. windows-x86_64: 0
  410. osname: windows-i686
  411. # mingw-w64 does not support SEH on 32bit systems. Be explicit about that.
  412. flag_noSEH: '-Wl,--no-seh'
  413. windows:
  414. var:
  415. windows: 1
  416. container:
  417. suite: bullseye
  418. arch: amd64
  419. configure_opt: '--host=[% c("arch") %]-w64-mingw32 CFLAGS="[% c("var/CFLAGS") %]" LDFLAGS="[% c("var/LDFLAGS") %]" [% c("var/configure_opt_project") %]'
  420. CFLAGS: '-fstack-protector-strong -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security [% c("var/flag_mwindows") %]'
  421. LDFLAGS: '-Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -Wl,--no-insert-timestamp -lssp -L$gcclibs [% c("var/flag_HEASLR") %] [% c("var/flag_noSEH") %] [% c("var/flag_mwindows") %]'
  422. flag_mwindows: '-mwindows'
  423. compiler: mingw-w64
  424. faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
  425. deps:
  426. - build-essential
  427. - python3
  428. - python3-distutils
  429. - bison
  430. - automake
  431. - libtool
  432. - zip
  433. - unzip
  434. torbrowser-osx-x86_64:
  435. - osx-x86_64
  436. osx-x86_64:
  437. arch: x86_64
  438. var:
  439. osx: 1
  440. osname: osx-x86_64
  441. container:
  442. suite: bullseye
  443. arch: amd64
  444. compiler: 'macosx-toolchain'
  445. configure_opt: '--host=x86_64-apple-darwin CC="x86_64-apple-darwin-clang [% c("var/FLAGS") %]" CXX="x86_64-apple-darwin-clang++ [% c("var/FLAGS") %]" [% c("var/configure_opt_project") %]'
  446. FLAGS: "-target x86_64-apple-darwin -B $cctoolsdir -isysroot $sysrootdir"
  447. LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie"
  448. macosx_deployment_target: '10.12'
  449. locale_ja: ja-JP-mac
  450. rlbox: 0
  451. deps:
  452. - build-essential
  453. - python3
  454. - python3-distutils
  455. - automake
  456. - libtool
  457. - zip
  458. - unzip
  459. faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
  460. set_PTDIR_DOCSDIR: |
  461. PTDIR="$distdir/Contents/MacOS/Tor/PluggableTransports"
  462. DOCSDIR="$distdir/Contents/Resources/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
  463. # The no_build_id target can be useful if you want to quickly display
  464. # a build template or other option but don't want to spend time to
  465. # compute the various build ids
  466. no_build_id:
  467. # The defaut timestamp value will use the commit time of the
  468. # selected commit for the project, which will require cloning the
  469. # git repository if it is not present. When we use the no_build_id
  470. # target to display a script, we usually don't care about such
  471. # details, so we set timestamp to 0 to avoid unnecessary cloning.
  472. timestamp: 0
  473. var:
  474. build_id: 1
  475. no_containers:
  476. var:
  477. container:
  478. global_disable: 1
  479. # change the default gpg_wrapper to allow git tag signed using an
  480. # expired key.
  481. # https://bugs.torproject.org/19737
  482. gpg_wrapper: |
  483. #!/bin/bash
  484. export LC_ALL=C
  485. [%
  486. IF c('gpg_keyring');
  487. SET gpg_kr = '--keyring ' _ path(c('gpg_keyring'), path(c('gpg_keyring_dir'))) _ ' --no-default-keyring';
  488. END;
  489. -%]
  490. gpg_verify=0
  491. for opt in "$@"
  492. do
  493. test "$opt" = '--verify' && gpg_verify=1
  494. done
  495. if [ $gpg_verify = 1 ]
  496. then
  497. [% c('gpg_bin') %] [% c('gpg_args') %] --with-fingerprint [% gpg_kr %] "$@" | sed 's/^\[GNUPG:\] EXPKEYSIG /\[GNUPG:\] GOODSIG /'
  498. exit ${PIPESTATUS[0]}
  499. else
  500. exec [% c('gpg_bin') %] [% c('gpg_args') %] --with-fingerprint [% gpg_kr %] "$@"
  501. fi
  502. remote_start: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_start") %][% END %]'
  503. remote_exec: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_exec") %][% END %]'
  504. remote_put: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_put") %][% END %]'
  505. remote_get: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_get") %][% END %]'
  506. remote_finish: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_finish") %][% END %]'
  507. container:
  508. remote_start: |
  509. #!/bin/sh
  510. set -e
  511. if [ $(ls -1 '[% c("remote_srcdir", { error_if_undef => 1 }) %]/container-image_'* | wc -l) -ne 1 ]
  512. then
  513. echo "Can't find container image in input files" >&2
  514. ls -l '[% c("remote_srcdir") %]' >&2
  515. exit 1
  516. fi
  517. [% c("rbmdir") %]/container extract '[% c("var/container/dir") %]' '[% c("remote_srcdir", { error_if_undef => 1 }) %]/container-image_'*
  518. test -d '[% c("var/container/dir") %]'/home/rbm || \
  519. [% c("rbmdir") %]/container run --chroot='[% c("var/container/dir") %]' -- /usr/sbin/useradd -m [% c("var/container/user") %]
  520. remote_exec: |
  521. #!/bin/sh
  522. set -e
  523. [% IF c("interactive") -%]
  524. echo Container directory: [% shell_quote(c("var/container/dir")) %]
  525. [% END -%]
  526. mkdir -p '[% c("var/container/dir", { error_if_undef => 1 }) %]'/rbm
  527. echo '#!/bin/sh' > '[% c("var/container/dir") %]'/rbm/cmd
  528. echo [% shell_quote(c('exec_cmd')) %] >> '[% c("var/container/dir") %]'/rbm/cmd
  529. echo '#!/bin/sh' > '[% c("var/container/dir") %]'/rbm/run
  530. [% IF c("var/container/disable_network/" _ c("exec_name")) -%]
  531. # Some programs such as gradle need the lo interface to be up.
  532. # See for example tor-browser#31293
  533. echo 'ip link set lo up' >> '[% c("var/container/dir") %]'/rbm/run
  534. [% END -%]
  535. [% IF c('exec_as_root'); SET user = 'root'; ELSE; SET user = c("var/container/user", { error_if_undef => 1 }); END; %]
  536. echo 'su - [% user %] -c /rbm/cmd' >> '[% c("var/container/dir") %]'/rbm/run
  537. chmod +x '[% c("var/container/dir") %]'/rbm/cmd
  538. chmod +x '[% c("var/container/dir") %]'/rbm/run
  539. [%
  540. IF c("var/container/disable_network/" _ c("exec_name"));
  541. SET disable_network = '--disable-network';
  542. ELSE;
  543. SET disable_network = '';
  544. END;
  545. -%]
  546. [% c("rbmdir") %]/container run [% disable_network %] --chroot='[% c("var/container/dir") %]' -- /rbm/run
  547. remote_put: |
  548. #!/bin/sh
  549. set -e
  550. [%
  551. SET src = shell_quote(c('put_src', { error_if_undef => 1 }));
  552. SET dst = shell_quote(c('put_dst', { error_if_undef => 1 }));
  553. -%]
  554. [% c("rbmdir") %]/container put '[% c("var/container/dir") %]' [% src %] [% dst %] [% c("var/container/user") %]
  555. remote_get: |
  556. #!/bin/sh
  557. set -e
  558. [%
  559. SET src = shell_quote(c('get_src', { error_if_undef => 1 }));
  560. SET dst = shell_quote(c('get_dst', { error_if_undef => 1 }));
  561. -%]
  562. [% c("rbmdir") %]/container get '[% c("var/container/dir") %]' [% src %] [% dst %]
  563. remote_finish: |
  564. #!/bin/sh
  565. set -e
  566. [% c("rbmdir") %]/container remove '[% c("var/container/dir") %]'
  567. ENV:
  568. TZ: UTC
  569. LC_ALL: C
  570. --- |
  571. # This part of the file contains options written in perl
  572. use IO::CaptureOutput qw(capture_exec);
  573. (
  574. var_p => {
  575. nightly_torbrowser_version => sub {
  576. state $version = '';
  577. return $version if $version;
  578. my (undef, undef, undef, $day, $mon, $year) = gmtime;
  579. $version = sprintf("tbb-nightly.%u.%02u.%02u", $year + 1900, $mon + 1, $day);
  580. return $version;
  581. },
  582. nightly_torbrowser_incremental_from => sub {
  583. my ($project, $options) = @_;
  584. my $nightly_dir = project_config($project, 'basedir', $options) . '/nightly';
  585. my $current_version = project_config($project, 'var/torbrowser_version', $options);
  586. use Path::Tiny;
  587. return [] unless -d $nightly_dir;
  588. my @dirs = sort map { $_->basename } path($nightly_dir)->children(qr/^tbb-nightly\./);
  589. my $nb_incr = project_config($project, ['var', 'max_torbrowser_incremental_from'], $options);
  590. my @res;
  591. while ($nb_incr > 0) {
  592. my $dir = pop @dirs;
  593. last unless $dir;
  594. next if $dir eq $current_version;
  595. $nb_incr--;
  596. push @res, $dir;
  597. }
  598. return [@res];
  599. },
  600. },
  601. )