Fix YAML syntax for Python heredoc
This commit is contained in:
12
kibot-ci.yml
12
kibot-ci.yml
@@ -381,18 +381,14 @@ upload_packages:
|
||||
- job: inventree_main
|
||||
artifacts: true
|
||||
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
|
||||
basename=$(basename "$zipfile" .zip)
|
||||
url="${PACKAGE_REGISTRY_URL}/${VERSION}/${basename}-${VERSION}.zip"
|
||||
echo "Uploading: $zipfile to $url"
|
||||
python3 -c "
|
||||
python3 << EOF
|
||||
import urllib.request
|
||||
with open('$zipfile', 'rb') as f:
|
||||
data = f.read()
|
||||
@@ -400,7 +396,7 @@ req = urllib.request.Request('$url', data=data, method='PUT')
|
||||
req.add_header('JOB-TOKEN', '${CI_JOB_TOKEN}')
|
||||
urllib.request.urlopen(req)
|
||||
print('Upload complete')
|
||||
"
|
||||
EOF
|
||||
done
|
||||
artifacts:
|
||||
when: always
|
||||
|
||||
Reference in New Issue
Block a user