Enhance sh to make curl use the same connection (#3825)

This commit is contained in:
Simon Bomm 2022-08-11 09:52:49 +02:00 committed by GitHub
parent 394f827f58
commit 2a9c19c12d
1 changed files with 9 additions and 4 deletions

View File

@ -67,11 +67,16 @@ stage('RPM Delivery') {
withCredentials([usernamePassword(credentialsId: 'nexus-credentials', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USERNAME')]) {
checkout scm
unstash "Debian11"
sh '''for i in $(echo *.deb)
do
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD -H "Content-Type: multipart/form-data" --data-binary "@./$i" https://apt.centreon.com/repository/$REPO/
sh '''for package in $(echo *.deb)
do
if [ -z "$FILELIST" ]
then
FILELIST=$file
fi
FILELIST=${FILELIST},$file
done
'''
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD -H \"Content-Type: multipart/form-data\" -T \"{$FILELIST}\" https://apt.centreon.com/repository/$REPO/"
'''
}
}
}