rbm.conf 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  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. torbrowser-linux-ppc64le:
  333. - linux-ppc64le
  334. - linux-cross
  335. - linux
  336. linux-x86_64:
  337. arch: x86_64
  338. var:
  339. linux-x86_64: 1
  340. osname: linux-x86_64
  341. linux-cross: 0
  342. arch_debian: amd64
  343. arch_kernel: x86
  344. # We only support RLBox on the nightly channel and x86_64 for now
  345. rlbox: 0
  346. linux-i686:
  347. arch: i686
  348. var:
  349. linux-i686: 1
  350. osname: linux-i686
  351. linux-cross: 0
  352. configure_opt: '--host=i686-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 [% c("var/configure_opt_project") %]'
  353. arch_debian: i386
  354. arch_kernel: x86
  355. linux-arm:
  356. arch: arm
  357. var:
  358. linux-arm: 1
  359. osname: linux-arm
  360. crosstarget: arm-linux-gnueabihf
  361. configure_opt: '--host=arm-linux-gnueabihf [% c("var/configure_opt_project") %]'
  362. arch_debian: armhf
  363. arch_kernel: arm
  364. linux-ppc64le:
  365. arch: ppc64le
  366. var:
  367. linux-ppc64le: 1
  368. osname: linux-ppc64le
  369. crosstarget: powerpc64le-linux-gnu
  370. configure_opt: '--host=powerpc64le-linux-gnu [% c("var/configure_opt_project") %]'
  371. arch_debian: ppc64el
  372. arch_kernel: powerpc
  373. linux-cross:
  374. var:
  375. linux-cross: 1
  376. container:
  377. arch: amd64
  378. linux:
  379. var:
  380. linux: 1
  381. compiler: gcc
  382. configure_opt: '[% c("var/configure_opt_project") %]'
  383. # Only build Namecoin for linux on nightly
  384. namecoin: '[% c("var/nightly") %]'
  385. container:
  386. suite: jessie
  387. arch: amd64
  388. pre_pkginst: dpkg --add-architecture i386
  389. deps:
  390. - libc6-dev-i386
  391. - lib32stdc++6
  392. - build-essential
  393. - python
  394. - bison
  395. - hardening-wrapper
  396. - automake
  397. - libtool
  398. - zip
  399. - unzip
  400. linux-asan:
  401. var:
  402. asan: 1
  403. # RLBox needs clang to create .wasm files but we use mostly GCC for our
  404. # ASan builds. Thus, the compilation currently breaks with RLBox enabled.
  405. # See: tor-browser-build#40063.
  406. rlbox: 0
  407. torbrowser-windows-i686:
  408. - windows-i686
  409. - windows
  410. torbrowser-windows-x86_64:
  411. - windows-x86_64
  412. - windows
  413. windows-x86_64:
  414. arch: x86_64
  415. var:
  416. windows-x86_64: 1
  417. windows-i686: 0
  418. osname: windows-x86_64
  419. # HEASLR is 64 bit only (see bug 12968)
  420. flag_HEASLR: '-Wl,--high-entropy-va'
  421. windows-i686:
  422. arch: i686
  423. var:
  424. windows-i686: 1
  425. windows-x86_64: 0
  426. osname: windows-i686
  427. # mingw-w64 does not support SEH on 32bit systems. Be explicit about that.
  428. flag_noSEH: '-Wl,--no-seh'
  429. windows:
  430. var:
  431. windows: 1
  432. container:
  433. suite: bullseye
  434. arch: amd64
  435. configure_opt: '--host=[% c("arch") %]-w64-mingw32 CFLAGS="[% c("var/CFLAGS") %]" LDFLAGS="[% c("var/LDFLAGS") %]" [% c("var/configure_opt_project") %]'
  436. CFLAGS: '-fstack-protector-strong -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security [% c("var/flag_mwindows") %]'
  437. 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") %]'
  438. flag_mwindows: '-mwindows'
  439. compiler: mingw-w64
  440. faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
  441. deps:
  442. - build-essential
  443. - python3
  444. - python3-distutils
  445. - bison
  446. - automake
  447. - libtool
  448. - zip
  449. - unzip
  450. torbrowser-osx-x86_64:
  451. - osx-x86_64
  452. osx-x86_64:
  453. arch: x86_64
  454. var:
  455. osx: 1
  456. osname: osx-x86_64
  457. container:
  458. suite: bullseye
  459. arch: amd64
  460. compiler: 'macosx-toolchain'
  461. 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") %]'
  462. FLAGS: "-target x86_64-apple-darwin -B $cctoolsdir -isysroot $sysrootdir"
  463. LDFLAGS: "-Wl,-syslibroot,$sysrootdir -Wl,-dead_strip -Wl,-pie"
  464. macosx_deployment_target: '10.12'
  465. locale_ja: ja-JP-mac
  466. rlbox: 0
  467. deps:
  468. - build-essential
  469. - python3
  470. - python3-distutils
  471. - automake
  472. - libtool
  473. - zip
  474. - unzip
  475. faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
  476. set_PTDIR_DOCSDIR: |
  477. PTDIR="$distdir/Contents/MacOS/Tor/PluggableTransports"
  478. DOCSDIR="$distdir/Contents/Resources/TorBrowser/Docs/[% c("var/DOCSDIR_project") %]"
  479. # The no_build_id target can be useful if you want to quickly display
  480. # a build template or other option but don't want to spend time to
  481. # compute the various build ids
  482. no_build_id:
  483. # The defaut timestamp value will use the commit time of the
  484. # selected commit for the project, which will require cloning the
  485. # git repository if it is not present. When we use the no_build_id
  486. # target to display a script, we usually don't care about such
  487. # details, so we set timestamp to 0 to avoid unnecessary cloning.
  488. timestamp: 0
  489. var:
  490. build_id: 1
  491. no_containers:
  492. var:
  493. container:
  494. global_disable: 1
  495. # change the default gpg_wrapper to allow git tag signed using an
  496. # expired key.
  497. # https://bugs.torproject.org/19737
  498. gpg_wrapper: |
  499. #!/bin/bash
  500. export LC_ALL=C
  501. [%
  502. IF c('gpg_keyring');
  503. SET gpg_kr = '--keyring ' _ path(c('gpg_keyring'), path(c('gpg_keyring_dir'))) _ ' --no-default-keyring';
  504. END;
  505. -%]
  506. gpg_verify=0
  507. for opt in "$@"
  508. do
  509. test "$opt" = '--verify' && gpg_verify=1
  510. done
  511. if [ $gpg_verify = 1 ]
  512. then
  513. [% c('gpg_bin') %] [% c('gpg_args') %] --with-fingerprint [% gpg_kr %] "$@" | sed 's/^\[GNUPG:\] EXPKEYSIG /\[GNUPG:\] GOODSIG /'
  514. exit ${PIPESTATUS[0]}
  515. else
  516. exec [% c('gpg_bin') %] [% c('gpg_args') %] --with-fingerprint [% gpg_kr %] "$@"
  517. fi
  518. remote_start: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_start") %][% END %]'
  519. remote_exec: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_exec") %][% END %]'
  520. remote_put: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_put") %][% END %]'
  521. remote_get: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_get") %][% END %]'
  522. remote_finish: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("container/remote_finish") %][% END %]'
  523. container:
  524. remote_start: |
  525. #!/bin/sh
  526. set -e
  527. if [ $(ls -1 '[% c("remote_srcdir", { error_if_undef => 1 }) %]/container-image_'* | wc -l) -ne 1 ]
  528. then
  529. echo "Can't find container image in input files" >&2
  530. ls -l '[% c("remote_srcdir") %]' >&2
  531. exit 1
  532. fi
  533. [% c("rbmdir") %]/container extract '[% c("var/container/dir") %]' '[% c("remote_srcdir", { error_if_undef => 1 }) %]/container-image_'*
  534. test -d '[% c("var/container/dir") %]'/home/rbm || \
  535. [% c("rbmdir") %]/container run --chroot='[% c("var/container/dir") %]' -- /usr/sbin/useradd -m [% c("var/container/user") %]
  536. remote_exec: |
  537. #!/bin/sh
  538. set -e
  539. [% IF c("interactive") -%]
  540. echo Container directory: [% shell_quote(c("var/container/dir")) %]
  541. [% END -%]
  542. mkdir -p '[% c("var/container/dir", { error_if_undef => 1 }) %]'/rbm
  543. echo '#!/bin/sh' > '[% c("var/container/dir") %]'/rbm/cmd
  544. echo [% shell_quote(c('exec_cmd')) %] >> '[% c("var/container/dir") %]'/rbm/cmd
  545. echo '#!/bin/sh' > '[% c("var/container/dir") %]'/rbm/run
  546. [% IF c("var/container/disable_network/" _ c("exec_name")) -%]
  547. # Some programs such as gradle need the lo interface to be up.
  548. # See for example tor-browser#31293
  549. echo 'ip link set lo up' >> '[% c("var/container/dir") %]'/rbm/run
  550. [% END -%]
  551. [% IF c('exec_as_root'); SET user = 'root'; ELSE; SET user = c("var/container/user", { error_if_undef => 1 }); END; %]
  552. echo 'su - [% user %] -c /rbm/cmd' >> '[% c("var/container/dir") %]'/rbm/run
  553. chmod +x '[% c("var/container/dir") %]'/rbm/cmd
  554. chmod +x '[% c("var/container/dir") %]'/rbm/run
  555. [%
  556. IF c("var/container/disable_network/" _ c("exec_name"));
  557. SET disable_network = '--disable-network';
  558. ELSE;
  559. SET disable_network = '';
  560. END;
  561. -%]
  562. [% c("rbmdir") %]/container run [% disable_network %] --chroot='[% c("var/container/dir") %]' -- /rbm/run
  563. remote_put: |
  564. #!/bin/sh
  565. set -e
  566. [%
  567. SET src = shell_quote(c('put_src', { error_if_undef => 1 }));
  568. SET dst = shell_quote(c('put_dst', { error_if_undef => 1 }));
  569. -%]
  570. [% c("rbmdir") %]/container put '[% c("var/container/dir") %]' [% src %] [% dst %] [% c("var/container/user") %]
  571. remote_get: |
  572. #!/bin/sh
  573. set -e
  574. [%
  575. SET src = shell_quote(c('get_src', { error_if_undef => 1 }));
  576. SET dst = shell_quote(c('get_dst', { error_if_undef => 1 }));
  577. -%]
  578. [% c("rbmdir") %]/container get '[% c("var/container/dir") %]' [% src %] [% dst %]
  579. remote_finish: |
  580. #!/bin/sh
  581. set -e
  582. [% c("rbmdir") %]/container remove '[% c("var/container/dir") %]'
  583. ENV:
  584. TZ: UTC
  585. LC_ALL: C
  586. --- |
  587. # This part of the file contains options written in perl
  588. use IO::CaptureOutput qw(capture_exec);
  589. (
  590. var_p => {
  591. nightly_torbrowser_version => sub {
  592. state $version = '';
  593. return $version if $version;
  594. my (undef, undef, undef, $day, $mon, $year) = gmtime;
  595. $version = sprintf("tbb-nightly.%u.%02u.%02u", $year + 1900, $mon + 1, $day);
  596. return $version;
  597. },
  598. nightly_torbrowser_incremental_from => sub {
  599. my ($project, $options) = @_;
  600. my $nightly_dir = project_config($project, 'basedir', $options) . '/nightly';
  601. my $current_version = project_config($project, 'var/torbrowser_version', $options);
  602. use Path::Tiny;
  603. return [] unless -d $nightly_dir;
  604. my @dirs = sort map { $_->basename } path($nightly_dir)->children(qr/^tbb-nightly\./);
  605. my $nb_incr = project_config($project, ['var', 'max_torbrowser_incremental_from'], $options);
  606. my @res;
  607. while ($nb_incr > 0) {
  608. my $dir = pop @dirs;
  609. last unless $dir;
  610. next if $dir eq $current_version;
  611. $nb_incr--;
  612. push @res, $dir;
  613. }
  614. return [@res];
  615. },
  616. },
  617. )