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: |