Commit 5b0dc141 authored by Raphaël Hertzog's avatar Raphaël Hertzog

Fix check of curl return code by moving echo call

Before this commit the check of $? checks the success of "echo" instead
of the "curl" call.
parent 844da52f
......@@ -30,11 +30,12 @@ case $PROJECT_ID in
''|*[!0-9]*) echo "$PROJECT_NAME not found using $SALSA_URL service" ;;
*) curl -XPUT --header "PRIVATE-TOKEN: $SALSA_TOKEN" \
$SALSA_URL/projects/$PROJECT_ID/services/emails-on-push \
--data "recipients=$RECIPIENTS";
echo;
--data "recipients=$RECIPIENTS"
if [ $? -eq 0 ]; then
echo
echo "All done."
else
echo
echo "Something went wrong!"
fi;;
esac
......@@ -28,11 +28,12 @@ case $ALREADY_HOOKED in
[0-9]*) echo "close service is already configured for $PROJECT_NAME" ;;
*) curl -XPOST --header "PRIVATE-TOKEN: $SALSA_TOKEN" \
$SALSA_URL/projects/$PROJECT_ID/hooks \
--data "url=$CLOSE_URL&push_events=1&tag_push_events=1&merge_requests_events=1&enable_ssl_verification=1";
echo;
--data "url=$CLOSE_URL&push_events=1&tag_push_events=1&merge_requests_events=1&enable_ssl_verification=1"
if [ $? -eq 0 ]; then
echo
echo "All done."
else
echo
echo "Something went wrong!"
fi;;
esac
......@@ -27,11 +27,12 @@ case $ALREADY_HOOKED in
[0-9]*) echo "tagpending service is already configured for $PROJECT_NAME" ;;
*) curl -XPOST --header "PRIVATE-TOKEN: $SALSA_TOKEN" \
$SALSA_URL/projects/$PROJECT_ID/hooks \
--data "url=$TAGPENDING_URL&push_events=1&tag_push_events=1&merge_requests_events=1&enable_ssl_verification=1";
echo;
--data "url=$TAGPENDING_URL&push_events=1&tag_push_events=1&merge_requests_events=1&enable_ssl_verification=1"
if [ $? -eq 0 ]; then
echo
echo "All done."
else
echo
echo "Something went wrong!"
fi;;
esac
......@@ -26,11 +26,12 @@ case $PROJECT_ID in
''|*[!0-9]*) echo "$PROJECT_NAME not found using $SALSA_URL service" ;;
*) curl -XPUT --header "PRIVATE-TOKEN: $SALSA_TOKEN" \
$SALSA_URL/projects/$PROJECT_ID/services/irker \
--data "recipients=$IRC_CHANNEL&server_host=$IRKER_URL&colorize_messages=1";
echo;
--data "recipients=$IRC_CHANNEL&server_host=$IRKER_URL&colorize_messages=1"
if [ $? -eq 0 ]; then
echo
echo "All done."
else
echo
echo "Something went wrong!"
fi;;
esac
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment