Calendar: remove past event
[tails/test.git] / bin / add-release-to-iso-history
blobdf5828aaba14ea3cdaa6b2ec73ccb62b11b24aa6
1 #!/bin/bash
3 set -eu
4 set -o pipefail
6 NAME=$(basename "${0}")
7 LONGOPTS="version:,isos:,release-branch:,matching-jenkins-images-build-id:"
8 OPTS=$(getopt -o "" --longoptions $LONGOPTS -n "${NAME}" -- "$@")
9 eval set -- "$OPTS"
10 while [ $# -gt 0 ]; do
11 case $1 in
12 --version)
13 shift
14 VERSION="$1"
16 --isos)
17 shift
18 ISOS="$1"
20 --release-branch)
21 shift
22 RELEASE_BRANCH="$1"
24 --matching-jenkins-images-build-id)
25 shift
26 MATCHING_JENKINS_IMAGES_BUILD_ID="$1"
28 esac
29 shift
30 done
32 ssh misc.lizard mkdir "tails-amd64-${VERSION:?}"
34 scp "${ISOS:?}/tails-amd64-${VERSION:?}/tails-amd64-${VERSION:?}."{apt-sources,build-manifest,buildlog,packages,iso.sig,img.sig} \
35 "misc.lizard:tails-amd64-${VERSION:?}"
37 ssh misc.lizard gpg --import < "wiki/src/tails-signing.key"
39 ssh misc.lizard << EOF
40 cd tails-amd64-${VERSION:?} && \
41 wget --quiet \
42 "https://nightly.tails.boum.org/build_Tails_ISO_${RELEASE_BRANCH:?}/builds/${MATCHING_JENKINS_IMAGES_BUILD_ID:?}/archive/build-artifacts/tails-amd64-${VERSION:?}.iso" \
43 "https://nightly.tails.boum.org/build_Tails_ISO_${RELEASE_BRANCH:?}/builds/${MATCHING_JENKINS_IMAGES_BUILD_ID:?}/archive/build-artifacts/tails-amd64-${VERSION:?}.img" && \
44 gpg --verify tails-amd64-${VERSION:?}.iso{.sig,} && \
45 gpg --verify tails-amd64-${VERSION:?}.img{.sig,}
46 EOF
48 ssh misc.lizard << EOF
49 ( [ -d isos ] || git clone gitolite@puppet-git.lizard:isos.git ) && \
50 cd isos && \
51 git annex init && \
52 git annex sync && \
53 git annex import ../tails-amd64-${VERSION:?} && \
54 rmdir ../tails-amd64-${VERSION:?} && \
55 git commit -m "Add Tails ${VERSION:?}" && \
56 git annex sync && \
57 git annex copy tails-amd64-${VERSION:?} --to origin && \
58 git annex drop tails-amd64-${VERSION:?} && \
59 git annex sync
60 EOF