*Initial version

This commit is contained in:
Derrick Hammer 2022-09-27 19:19:52 -04:00
parent 14c175d7af
commit f7f014e711
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 24 additions and 0 deletions

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM alpine
ADD aptly.sh /bin/
RUN chmod +x /bin/aptly.sh
RUN apk -Uuv add curl ca-certificates bash jo
ENTRYPOINT /bin/aptly.sh

19
aptly.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
APT_SERVICE_API="https://apt.lumeweb.com"
USERNAME="${PLUGIN_APT_USERNAME}"
PASSWORD="${PLUGIN_APT_PASSWORD}"
SNAPSHOT_NAME=$(date -u -%s)
PACKAGE_NAME="$(basename ${PLUGIN_PACKAGE} .deb)"
curl -u "${USERNAME}:${PASSWORD}" -X POST -F file=@${PLUGIN_PACKAGE} "http://${APT_SERVICE_API}/api/files/${PACKAGE_NAME}"
curl -u "${USERNAME}:${PASSWORD}" -X POST -F file=@${PLUGIN_PACKAGE} "http://${APT_SERVICE_API}/api/repos/${PLUGIN_REPO}/file/${PACKAGE_NAME}"
JSON=$(jo Name="${SNAPSHOT_NAME}" Passphrase="${PLUGIN_GPG_PASSWORD}")
curl -u "${USERNAME}:${PASSWORD}" ${APT_SERVICE_API}/api/repos/${PLUGIN_REPO}/snapshots -d "${JSON}"
JSON=$(jo Storage="s3" Prefix="." Distribution="ubuntu" Architectures="amd64" Passphrase="${PLUGIN_GPG_PASSWORD}")
curl -u "${USERNAME}:${PASSWORD}" ${APT_SERVICE_API}/api/publish -d "${JSON}"