Merge branch 'stable' into devel
[tails.git] / bin / generate-images-signatures-and-torrents
blobd7c7f5a264473b61fab21f9ea0507af92458e938
1 #!/bin/bash
3 set -eu
4 set -x
6 mkdir -p "${ISOS:?}/tails-amd64-${VERSION:?}"
7 for type in iso img ; do
8 cd "${ISOS:?}/tails-amd64-${VERSION:?}"
9 mv "${ARTIFACTS:?}/tails-amd64-${VERSION:?}.${type:?}" .
10 gpg --armor --default-key "${TAILS_SIGNATURE_KEY:?}" \
11 --detach-sign -- *".${type:?}"
12 rename 's,\.asc$,.sig,' -- *.asc
13 tmp="$(mktemp -d)"
14 mkdir -p "${tmp:?}/tails-amd64-${VERSION:?}-${type:?}"
15 cd "${tmp:?}/tails-amd64-${VERSION:?}-${type:?}"
16 # shellcheck disable=SC2231
17 for x in "${ISOS:?}/tails-amd64-${VERSION:?}"/*.${type:?}*; do
18 ln -s "${x}" .
19 done
20 mktorrent \
21 -o "${ISOS:?}/tails-amd64-${VERSION:?}.${type:?}.torrent" \
22 -a 'udp://tracker.torrent.eu.org:451' \
23 -a 'udp://tracker.coppersurfer.tk:6969' \
24 "${tmp:?}/tails-amd64-${VERSION:?}-${type:?}"
25 transmission-show "${ISOS:?}/tails-amd64-${VERSION:?}.${type:?}.torrent"
26 cd -
27 rm -rf "${tmp:?}"
28 done
29 mv "${ARTIFACTS:?}/tails-amd64-${VERSION:?}".{apt-sources,build-manifest,buildlog,packages} \
30 "${ISOS:?}/tails-amd64-${VERSION:?}"
31 cd "${RELEASE_CHECKOUT?:}"