Fix upload_packages: use Python urllib (no curl/wget in image)
This commit is contained in:
12
kibot-ci.yml
12
kibot-ci.yml
@@ -387,12 +387,20 @@ upload_packages:
|
||||
# Create combined zip
|
||||
zip -r Fabrication/All.zip Fabrication/
|
||||
|
||||
# Upload each zip to package registry (curl is pre-installed in the image)
|
||||
# Upload each zip to package registry using Python (curl/wget not available in image)
|
||||
for zipfile in $(find Fabrication/ -maxdepth 1 -name '*.zip'); do
|
||||
basename=$(basename "$zipfile" .zip)
|
||||
url="${PACKAGE_REGISTRY_URL}/${VERSION}/${basename}-${VERSION}.zip"
|
||||
echo "Uploading: $zipfile to $url"
|
||||
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "$zipfile" "$url"
|
||||
python3 -c "
|
||||
import urllib.request
|
||||
with open('$zipfile', 'rb') as f:
|
||||
data = f.read()
|
||||
req = urllib.request.Request('$url', data=data, method='PUT')
|
||||
req.add_header('JOB-TOKEN', '${CI_JOB_TOKEN}')
|
||||
urllib.request.urlopen(req)
|
||||
print('Upload complete')
|
||||
"
|
||||
done
|
||||
artifacts:
|
||||
when: always
|
||||
|
||||
Reference in New Issue
Block a user