push deb to artifacts

This commit is contained in:
John
2022-02-19 10:46:54 +01:00
parent e013a998f8
commit 4139d7b3bf
3 changed files with 32 additions and 7 deletions
+7 -5
View File
@@ -12,10 +12,9 @@ if [[ -n "$LIMITARCH" ]]; then
fi
if [[ -z "$1" ]] || [[ "x$1" == "xrelease" ]]; then
UPLOAD_URL=
elif [[ -z "$UPLOAD_URL" ]]; then
UPLOAD_URL="http://$1/ebusdreleaseupload.php"
else
UPLOAD_CREDENTIALS=${UPLOAD_CREDENTIALS:-'anonymous:build'}
fi
UPLOAD_CREDENTIALS=${UPLOAD_CREDENTIALS:-'anonymous:build'}
version=`cat ../../VERSION`
source='../..'
images='bullseye'
@@ -35,9 +34,12 @@ elif [[ "x$1" = "xrelease" ]]; then
extratag="-t $tagprefix:latest"
else
namesuffix='.build'
target=build
target=deb
images='bullseye buster stretch'
outputFmt=
if [[ -n "$LIMITIMG" ]]; then
images=$(echo " $images " | sed -e "s#.* \($LIMITIMG\) .*#\1#")
fi
outputFmt='-o out/%IMAGE%'
tagsuffix=":v$version-prep"
fi
+2 -1
View File
@@ -32,7 +32,8 @@ replaceTemplate
if [[ -n "$1" ]]; then
# build releases update
make='./make_all.sh'
upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fs -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION" || echo "failed"; done; fi'
upload_lines='ARG UPLOAD_URL\nARG UPLOAD_CREDENTIALS\nARG UPLOAD_OS\nRUN if [ -n "\$UPLOAD_URL" ] \&\& [ -n "\$UPLOAD_CREDENTIALS" ]; then for img in ebusd-*.deb; do echo -n "upload \$img: "; curl -fsSk -u "\$UPLOAD_CREDENTIALS" -X POST --data-binary "@\$img" -H "Content-Type: application/octet-stream" "\$UPLOAD_URL/\$img?a=\$EBUSD_ARCH\&o=\$UPLOAD_OS\&v=\$EBUSD_VERSION" || echo "failed"; done; fi'
upload_lines+='\n\n\nFROM scratch as deb\nCOPY --from=build /build/*.deb /'
namesuffix='.build'
replaceTemplate
fi