Skip to content

Commit

Permalink
Clean up aptly.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn-Signal committed Jun 2, 2021
1 parent bd46e3a commit 9d81b7e
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions aptly.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright 2017-2020 Signal Messenger, LLC
#!/bin/bash

# Copyright 2017-2021 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only

#!/bin/bash
# Setup - creates the local repo which will be mirrored up to S3, then back-fill it. Your
# future deploys will eliminate all old versions without these backfill steps:
# aptly repo create signal-desktop
Expand All @@ -26,30 +27,34 @@
# Release:
# NAME=signal-desktop(-beta) VERSION=X.X.X ./aptly.sh

set -e
set -u
set -o pipefail

echo "Releasing $NAME build version $VERSION"

REPO=signal-desktop
CURRENT=xenial
# PREVIOUS=xenial
ENDPOINT=signal-desktop-apt # Matches endpoint name in .aptly.conf
SNAPSHOT=signal-desktop_v$VERSION
SNAPSHOT="signal-desktop_v$VERSION"
GPG_KEYID=57F6FB06

aptly repo add $REPO release/$NAME\_$VERSION\_*.deb
aptly snapshot create $SNAPSHOT from repo $REPO
aptly repo add "$REPO" "release/$NAME\_$VERSION\_*.deb"
aptly snapshot create "$SNAPSHOT" from repo "$REPO"

# run these only on first release to a given repo from a given machine. the first set is
# for local testing, the second set is to set up the production server.
# https://www.aptly.info/doc/aptly/publish/snapshot/
# aptly publish snapshot -gpg-key=$GPG_KEYID -distribution=$CURRENT $SNAPSHOT
# aptly publish snapshot -gpg-key=$GPG_KEYID -distribution=$PREVIOUS $SNAPSHOT
# aptly publish snapshot -gpg-key=$GPG_KEYID -distribution=$CURRENT -config=.aptly.conf $SNAPSHOT s3:$ENDPOINT:
# aptly publish snapshot -gpg-key=$GPG_KEYID -distribution=$PREVIOUS -config=.aptly.conf $SNAPSHOT s3:$ENDPOINT:
aptly publish snapshot -gpg-key="$GPG_KEYID" -distribution="$CURRENT" "$SNAPSHOT"
# aptly publish snapshot -gpg-key="$GPG_KEYID" -distribution="$PREVIOUS" "$SNAPSHOT"
aptly publish snapshot -gpg-key="$GPG_KEYID" -distribution="$CURRENT" -config=.aptly.conf "$SNAPSHOT" "s3:$ENDPOINT:"
# aptly publish snapshot -gpg-key="$GPG_KEYID" -distribution="$PREVIOUS" -config=.aptly.conf "$SNAPSHOT" "s3:$ENDPOINT:"

# these update already-published repos, run every time after that
# https://www.aptly.info/doc/aptly/publish/switch/
aptly publish switch -gpg-key=$GPG_KEYID $CURRENT $SNAPSHOT
# aptly publish switch -gpg-key=$GPG_KEYID $PREVIOUS $SNAPSHOT
aptly publish switch -gpg-key=$GPG_KEYID -config=.aptly.conf $CURRENT s3:$ENDPOINT: $SNAPSHOT
# aptly publish switch -gpg-key=$GPG_KEYID -config=.aptly.conf $PREVIOUS s3:$ENDPOINT: $SNAPSHOT
aptly publish switch -gpg-key="$GPG_KEYID" "$CURRENT" "$SNAPSHOT"
# aptly publish switch -gpg-key="$GPG_KEYID" "$PREVIOUS" "$SNAPSHOT"
aptly publish switch -gpg-key="$GPG_KEYID" -config=.aptly.conf "$CURRENT" "s3:$ENDPOINT:" "$SNAPSHOT"
# aptly publish switch -gpg-key="$GPG_KEYID" -config=.aptly.conf "$PREVIOUS" "s3:$ENDPOINT:" "$SNAPSHOT"

0 comments on commit 9d81b7e

Please sign in to comment.