Skip to content

Instantly share code, notes, and snippets.

@towc
Created April 2, 2019 09:55
Show Gist options
  • Save towc/8b7fbf1fff80c207b5292776a9f7aee2 to your computer and use it in GitHub Desktop.
Save towc/8b7fbf1fff80c207b5292776a9f7aee2 to your computer and use it in GitHub Desktop.

arguments needed:

AWS_BUCKET
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
GPG_KEY
GPG_PASSPHRASE

optional envs:

AWS_REGION=eu-central-1

volumes needed:

./repo-path:/repo
FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y aptly
RUN apt-get install -y apt-transport-s3
RUN apt-get install -y gpg
RUN mkdir /root/.gnupg
COPY ./src /src
ENV AWS_REGION eu-central-1
WORKDIR src
CMD ./publish
#!/bin/bash
set -o xtrace
cp /src/.aptly.conf /root/.aptly.conf
sed -i "s/%%BUCKET%%/$AWS_BUCKET/" /root/.aptly.conf
sed -i "s/%%REGION%%/$AWS_REGION/" /root/.aptly.conf
aptly repo create aptly-repo
aptly repo edit -distribution=buster aptly-repo
aptly repo add aptly-repo /repo/*.deb
aptly snapshot create aptly-snap from repo aptly-repo
aptly publish snapshot -distribution=buster -gpg-key=$GPG_KEY -passphrase=$GPG_PASSPHRASE aptly-snap s3:$AWS_BUCKET:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment