HUDSON_SERVER=$(gbs cfg src_server)
passwdx=$(gbs cfg passwdx)
echo "Submiting your changes to build server"
-
-ret_string=$(curl -i -s -u$user:$passwd -Fname=package.tar.bz2 -Ffile0=@package.tar.bz2 -Fjson='{"parameter": [{"name": "package.tar.bz2", "file": "file0"},{"name":"pkg", "value":"'$prj_name'"},{"name":"parameters","value":"obsproject='$target_obsproject';passwdx='$passwdx'"}]}' -FSubmit=Build "$HUDSON_SERVER/job/build/build")
+ret_string=$(curl -k -i -s -u$user:$passwd -Fname=package.tar.bz2 -Ffile0=@package.tar.bz2 -Fjson='{"parameter": [{"name": "package.tar.bz2", "file": "file0"},{"name":"pkg", "value":"'$prj_name'"},{"name":"parameters","value":"obsproject='$target_obsproject';passwdx='$passwdx'"}]}' -FSubmit=Build "$HUDSON_SERVER/job/build/build")
echo $ret_string|grep '302' > /dev/null
sleep 2
-last_id=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/build/lastBuild/buildNumber"`
-result_json=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/build/$last_id/api/json"`
+last_id=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/build/lastBuild/buildNumber"`
+result_json=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/build/$last_id/api/json"`
last_prj=`echo $result_json|python -mjson.tool |grep "pkg" -A1|tail -1|cut -d'"' -f4`
last_user=`echo $result_json|python -mjson.tool |grep "userName" |cut -d'"' -f4`
# In case the last commit is not made by the user, supposed the last job triggered by '$user' is the one.
echo "Your request has been put in queue waiting to process"
while [ true ]
do
- ret_id=$(curl -s -u$user:$passwd "$HUDSON_SERVER/job/build/lastBuild/buildNumber")
+ ret_id=$(curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/build/lastBuild/buildNumber")
if [ "$last_id" != "$ret_id" ]; then
- result_json=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/build/$ret_id/api/json"`
+ result_json=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/build/$ret_id/api/json"`
last_prj=`echo $result_json|python -mjson.tool |grep "pkg" -A1|tail -1|cut -d'"' -f4`
last_user=`echo $result_json|python -mjson.tool |grep "userName" |cut -d'"' -f4`
if [ "$last_prj" == "$prj_name" -o "$last_user" != "$user" ]; then
offset=0
while :
do
- result_json=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/build/$build_id/api/json"`
+ result_json=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/build/$build_id/api/json"`
status=$(echo $result_json|python -mjson.tool |grep "building.*false")
if [ -n "$status" ]; then
break
fi
if [ -n "$verbose" ]; then
- length=`curl -s -u$user:$passwd "$HUDSON_SERVER/rest/projects/build/$build_id/console/" | cut -d ',' -f2|cut -d ':' -f2`
- curl -s -u$user:$passwd "$HUDSON_SERVER/rest/projects/build/$build_id/console/content" -d 'length'=$length -d 'offset'=$offset -G
+ length=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/rest/projects/build/$build_id/console/" | cut -d ',' -f2|cut -d ':' -f2`
+ curl -k -s -u$user:$passwd "$HUDSON_SERVER/rest/projects/build/$build_id/console/content" -d 'length'=$length -d 'offset'=$offset -G
offset=$length
else
echo -n '.'
result=`echo $result_json|python -mjson.tool |grep result|cut -d '"' -f4`
if [ x$result != xSUCCESS ]; then
- curl -u$user:$passwd "$HUDSON_SERVER/job/build/$build_id/consoleText" -G
+ curl -k -u$user:$passwd "$HUDSON_SERVER/job/build/$build_id/consoleText" -G
die 'Remote Server Exception'
else
echo "Your local changes has been submitted to build server."
tag=$1
project=$2
info_msg "Getting md5sum value for package $project at ref $tag, from server ..."
- string=`curl -s -i -u$user:$passwd -Fjson='{"parameter": [{"name": "tag", "value": "'$tag'"},{"name":"project", "value":"'$project'"}]}' -FSubmit=Build "$HUDSON_SERVER/job/srctar_md5sum/build"`
+ string=`curl -k -s -i -u$user:$passwd -Fjson='{"parameter": [{"name": "tag", "value": "'$tag'"},{"name":"project", "value":"'$project'"}]}' -FSubmit=Build "$HUDSON_SERVER/job/srctar_md5sum/build"`
sleep 2
echo $string|grep '302' > /dev/null
die "Server Error, please check your gbs configuration."
fi
- last_id=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/lastBuild/buildNumber"`
- result_json=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$last_id/api/json"`
+ last_id=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/lastBuild/buildNumber"`
+ result_json=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$last_id/api/json"`
last_prj=`echo $result_json|python -mjson.tool |grep "project" -A1|tail -1|cut -d'"' -f4`
last_user=`echo $result_json|python -mjson.tool |grep "userName" |cut -d'"' -f4`
# In case the last commit is not made by the user, supposed the last job triggered by '$user' is the one.
echo "Your request has been put in waiting queue of server, waiting to active ..."
while [ true ]
do
- ret_id=$(curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/lastBuild/buildNumber")
+ ret_id=$(curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/lastBuild/buildNumber")
if [ "$last_id" != "$ret_id" ]; then
- result_json=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$ret_id/api/json"`
+ result_json=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$ret_id/api/json"`
last_prj=`echo $result_json|python -mjson.tool |grep "project" -A1|tail -1|cut -d'"' -f4`
last_user=`echo $result_json|python -mjson.tool |grep "userName" |cut -d'"' -f4`
if [ "$last_prj" == "$project" -o "$last_user" != "$user" ]; then
# Waiting until the job finished
while [ true ]
do
- result_json=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/api/json"`
+ result_json=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/api/json"`
status=$(echo $result_json|python -mjson.tool |grep "building.*false")
if [ -n "$status" ]; then
break
done
echo ""
# Execuation result
- result_json=`curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/api/json"`
+ result_json=`curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/api/json"`
result=`echo $result_json|python -mjson.tool |grep result|cut -d '"' -f4`
if [ x$result != xSUCCESS ]; then
echo -e "${ERR_COLOR}==== LOG FROM REMOTE SERVER ============${NO_COLOR}"
- curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/consoleText"
+ curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/consoleText"
echo -e "${ERR_COLOR}========================================${NO_COLOR}"
die 'Remote Server Exception'
else
- srctar_md5sum=$(curl -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/consoleText" | sed -n 's/.*#!#\(.*\)#!#.*/\1/p')
+ srctar_md5sum=$(curl -k -s -u$user:$passwd "$HUDSON_SERVER/job/srctar_md5sum/$build_id/consoleText" | sed -n 's/.*#!#\(.*\)#!#.*/\1/p')
info_msg "md5sum output:"
echo " " "$srctar_md5sum"
echo ""