Skip to content
This repository was archived by the owner on Jul 17, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ENV KEYSERVER keyserver.ubuntu.com

ENV GNUPGHOME /.gnupg

ENV HOME /tmp

# install aptly
RUN echo deb http://repo.aptly.info/ squeeze main >> /etc/apt/sources.list
RUN apt-key adv --keyserver keys.gnupg.net --recv-keys E083A3782A194991
Expand Down
14 changes: 8 additions & 6 deletions debify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,20 @@ aptly publish repo \
-passphrase="$passphrase" \
$APTLY_REPO_NAME

mv ~/.aptly/public /repo
REPO=${HOME}/repo

mv ~/.aptly/public "$REPO"

if [ ! -z "$KEYSERVER" ] && [ ! -z "$URI" ]
then
release_sig_path=$(find /repo/dists -name Release.gpg | head -1)
release_sig_path=$(find "$REPO/dists" -name Release.gpg | head -1)
gpg_key_id=$(gpg --list-packets $release_sig_path | grep -oP "(?<=keyid ).+")

echo "# setup script for $URI" > /repo/go
echo "# setup script for $URI" > "$REPO/go"

case "$URI" in
https://*)
cat >> /repo/go <<-END
cat >> "$REPO/go" <<-END
if [ ! -e /usr/lib/apt/methods/https ]
then
apt-get update
Expand All @@ -64,12 +66,12 @@ fi
END
esac

cat >> /repo/go <<-END
cat >> "$REPO/go" <<-END
apt-key adv --keyserver $KEYSERVER --recv-keys $gpg_key_id
echo "deb $URI $APTLY_DISTRIBUTION $APTLY_COMPONENT" >> /etc/apt/sources.list

apt-get update
END
fi

tar -C /repo -czf /debs/repo.tar.gz .
tar -C "$REPO" -czf /debs/repo.tar.gz .