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