我正在尝试使用jenkins中的execute shell创建git repo 我得到了上面的错误
执行shell:
userid=$(curl -u ${JENKINS_USER}:${JENKINS_PW} ${BUILD_URL}/api/json | jq -r '.actions[1].causes[0].userId')
auth=$(jq '"${GIT_USER}:${GIT_PW}"' | base64)
reponame="${REPO_NAME}"
response=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic $auth" -d '{"scm": "git", "project": { "key": "CAMEL_FUSE" },"is_private": true,"description": "'"created by $userid"'" }' https://api.bitbucket.org/2.0/repositories/feidsi/$reponame --write-out %{http_code} --silent --output ./response.txt )
if [ "$response" -eq 200 ]
then
echo "Repo Created by ${userid}."
else
echo "Creation Failed. Triggered by ${userid}."
cat ./response.txt
exit 1
fi