Move nightly builds to Travis CI

This updates previous work in #739 to build
Debian packages and zip files for other OS.

All the build artifacts are uploaded to S3
public bucket `aptly-nightly` so that there's
archive for all the builds.

All `.deb` packages are automatically uploaded
to repo.aptly.info/nightly on build.
This commit is contained in:
Andrey Smirnov
2018-05-25 00:53:59 +03:00
parent 5f904a164c
commit b6fe16095b
4 changed files with 75 additions and 20 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
set -e
builds=build/
packages=${builds}*.deb
folder=`mktemp -u tmp.XXXXXXXXXXXXXXX`
aptly_user="$APTLY_USER"
aptly_password="$APTLY_PASSWORD"
aptly_api="https://internal.aptly.info"
for file in $packages; do
echo "Uploading $file..."
curl -sS -X POST -F "file=@$file" -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder
echo
done
if [[ "$1" = "nightly" ]]; then
aptly_repository=aptly-nightly
aptly_published=s3:repo.aptly.info:./nightly
echo "Adding packages to $aptly_repository..."
curl -sS -X POST -u $aptly_user:$aptly_password ${aptly_api}/api/repos/$aptly_repository/file/$folder
echo
echo "Updating published repo..."
curl -sS -X PUT -H 'Content-Type: application/json' --data \
'{"AcquireByHash": true, "Signing": {"Batch": true, "Keyring": "aptly.repo/aptly.pub",
"secretKeyring": "aptly.repo/aptly.sec", "PassphraseFile": "aptly.repo/passphrase"}}' \
-u $aptly_user:$aptly_password ${aptly_api}/api/publish/$aptly_published
echo
fi
curl -sS -X DELETE -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder
echo