Fix YAML syntax for Python heredoc

This commit is contained in:
timmyhadwen
2026-01-17 15:16:14 +10:00
parent 0dc6ff725f
commit 2b717d1795

View File

@@ -381,18 +381,14 @@ upload_packages:
- job: inventree_main - job: inventree_main
artifacts: true artifacts: true
script: script:
- apt-get update && apt-get -y install zip
- zip -r Fabrication/All.zip Fabrication/
- | - |
apt-get update && apt-get -y install zip
# Create combined zip
zip -r Fabrication/All.zip Fabrication/
# Upload each zip to package registry using Python (curl/wget not available in image)
for zipfile in $(find Fabrication/ -maxdepth 1 -name '*.zip'); do for zipfile in $(find Fabrication/ -maxdepth 1 -name '*.zip'); do
basename=$(basename "$zipfile" .zip) basename=$(basename "$zipfile" .zip)
url="${PACKAGE_REGISTRY_URL}/${VERSION}/${basename}-${VERSION}.zip" url="${PACKAGE_REGISTRY_URL}/${VERSION}/${basename}-${VERSION}.zip"
echo "Uploading: $zipfile to $url" echo "Uploading: $zipfile to $url"
python3 -c " python3 << EOF
import urllib.request import urllib.request
with open('$zipfile', 'rb') as f: with open('$zipfile', 'rb') as f:
data = f.read() data = f.read()
@@ -400,7 +396,7 @@ req = urllib.request.Request('$url', data=data, method='PUT')
req.add_header('JOB-TOKEN', '${CI_JOB_TOKEN}') req.add_header('JOB-TOKEN', '${CI_JOB_TOKEN}')
urllib.request.urlopen(req) urllib.request.urlopen(req)
print('Upload complete') print('Upload complete')
" EOF
done done
artifacts: artifacts:
when: always when: always