pkc
pkc

Reputation: 8516

Upload ipa to hockeyapp via shell script in jenkins

I am writing following shell script for uploading .ipa to hockey app using jenkins.

curl \
    -F "status=2" \
    -F "notify=1" \
    -F "notes=Testing manual upload using cURL" \
    -F "notes_type=0" \
    -F "ipa=/Users/Shared/Jenkins/Home/workspace/jenkinadhocIPA/build/Release-iphoneos/artifact/abc.ipa" \
    -H "X-HockeyAppToken: 77009df19f344ddea16bbd827f706ea6" \
    https://rink.hockeyapp.net/manage/apps/781072/app_versions/new 
    | python -m json.tool

enter image description here

I am receiving the following error at console :

14:49:02 + curl -F status=2 -F notify=1 -F 'notes=Testing manual upload using cURL' -F notes_type=0 -F ipa=/Users/Shared/Jenkins/Home/workspace/jenkinadhocIPA/build/Release-iphoneos/artifact/abc.ipa -H 'X-HockeyAppToken: 77009df19f344ddea16bbd827f706ea6' https://rink.hockeyapp.net/manage/apps/781072/app_versions/new 14:49:03 % Total % Received % Xferd Average Speed Time Time Time Current 14:49:03 Dload Upload Total Spent Left Speed 14:49:03 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 100 753 100 106 100
647 51 315 0:00:02 0:00:02 --:--:-- 315 100 753 100
106 100 647 51 315 0:00:02 0:00:02 --:--:-- 315 14:49:05 You are being redirected./Users/Shared/Jenkins/tmp/jenkins3915686678610481595.sh: line 10: syntax error near unexpected token `|'

enter image description here

Upvotes: 0

Views: 571

Answers (1)

Lukas Spieß
Lukas Spieß

Reputation: 2468

You need to prefix the filename with @ to have curl reference it as a file:

This enables uploading of binary files etc. To force the 'content' part to be a file, prefix the file name with an @ sign.

https://curl.haxx.se/docs/manpage.html#-F

Upvotes: 0

Related Questions