gitemailsonpush.sh 669 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/bash

set -ex

path=$(dirname $(readlink -f $0))
source ${path}/svn2git.rc

if [ -z $@ ]
then
	echo "Without any argument, we will work on the REPOS specified in svn2git.rc."
	excludes=${EXCLUDE_REPOS}
else
	excludes=
fi

projects=${@:-${REPOS}}

for p in $projects
do
	[ -z "`echo ${excludes} | grep -w ${p}`" ] || continue
	echo "Enabling \"Emails on push\" service for project ${SALSA_GROUP}/${p} ..."
	curl --request PUT \
	     --header "PRIVATE-TOKEN: ${SALSA_TOKEN}" \
	     --data "send_from_committer_email=1&disable_diffs=0&recipients=${SALSA_PROJECT_PUSH_MAIL}" \
	     ${SALSA_URL}/projects/${SALSA_GROUP}%2F${p}/services/emails-on-push
done

exit 0