mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
Merge pull request #845 from smira/upload-artifacts-fix
Fix upload artifacts script to fail, add release upload script
This commit is contained in:
@@ -92,3 +92,9 @@ deploy:
|
||||
on:
|
||||
branch: master
|
||||
condition: "$DEPLOY_BINARIES = yes"
|
||||
- provider: script
|
||||
script: bash upload-artifacts.sh release
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
condition: "$DEPLOY_BINARIES = yes"
|
||||
|
||||
@@ -337,15 +337,16 @@ class CreateMirror26Test(BaseTest):
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class CreateMirror27Test(BaseTest):
|
||||
"""
|
||||
create mirror: component with slashes, no stripping
|
||||
"""
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror27 http://linux.dell.com/repo/community/ubuntu wheezy openmanage/740"
|
||||
# TODO: disabled as linux.dell.com doesn't resolve
|
||||
# class CreateMirror27Test(BaseTest):
|
||||
# """
|
||||
# create mirror: component with slashes, no stripping
|
||||
# """
|
||||
# runCmd = "aptly mirror create --ignore-signatures mirror27 http://linux.dell.com/repo/community/ubuntu wheezy openmanage/740"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror show mirror27", "mirror_show")
|
||||
# def check(self):
|
||||
# self.check_output()
|
||||
# self.check_cmd_output("aptly mirror show mirror27", "mirror_show")
|
||||
|
||||
|
||||
class CreateMirror28Test(BaseTest):
|
||||
|
||||
+28
-4
@@ -8,10 +8,11 @@ folder=`mktemp -u tmp.XXXXXXXXXXXXXXX`
|
||||
aptly_user="$APTLY_USER"
|
||||
aptly_password="$APTLY_PASSWORD"
|
||||
aptly_api="https://internal.aptly.info"
|
||||
version=`make version`
|
||||
|
||||
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
|
||||
curl -fsS -X POST -F "file=@$file" -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder
|
||||
echo
|
||||
done
|
||||
|
||||
@@ -20,16 +21,39 @@ if [[ "$1" = "nightly" ]]; then
|
||||
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
|
||||
curl -fsS -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 \
|
||||
curl -fsS -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
|
||||
if [[ "$1" = "release" ]]; then
|
||||
aptly_repository=aptly-repository
|
||||
aptly_snapshot=aptly-$version
|
||||
aptly_published=s3:repo.aptly.info:./squeeze
|
||||
|
||||
echo "Adding packages to $aptly_repository..."
|
||||
curl -fsS -X POST -u $aptly_user:$aptly_password ${aptly_api}/api/repos/$aptly_repository/file/$folder
|
||||
echo
|
||||
|
||||
echo "Creating snapshot $aptly_snapshot from repo $aptly_repository..."
|
||||
curl -fsS -X POST -u $aptly_user:$aptly_password -H 'Content-Type: application/json' --data \
|
||||
"{\"Name\":\"$aptly_snapshot\"}" ${aptly_api}/api/repos/$aptly_repository/snapshots
|
||||
echo
|
||||
|
||||
echo "Switching published repo to use snapshot $aptly_snapshot..."
|
||||
curl -fsS -X PUT -H 'Content-Type: application/json' --data \
|
||||
"{\"AcquireByHash\": true, \"Snapshots\": [{\"Component\": \"main\", \"Name\": \"$aptly_snapshot\"}],
|
||||
\"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 -fsS -X DELETE -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user