filter_name="$@"
for repo in $(nb_repos); do
- [ -d "$repo/.git" ] || continue
- [ ! -w "$repo/.git" ] && echo ">No Permission $repo" && echo && continue
- cd "$repo" || continue
+ [ -d "$dir/.git" ] || continue
+ [ ! -w "$dir/.git" ] && echo ">No Permission $dir" && echo && continue
+ cd "$dir" || continue
# name from git not from path
name=$(git_name) || continue
#
# Get user
#
- user=`ls -dl "$repo/.git" | awk '{print $3}'`
+ user=`ls -dl "$dir/.git" | awk '{print $3}'`
cmd=""
#
# Pull
#
- echo ">Pull $name branch=$branch user=$user path=$repo"
+ echo ">Pull $name branch=$branch user=$user path=$dir"
- cmd="${cmd}GIT_SSH=$GIT_SSH cd \"$repo\" && git pull"
+ cmd="${cmd}GIT_SSH=$GIT_SSH cd \"$dir\" && git pull"
[ "$CLEANUP" = "1" ] && cmd="$cmd && git gc"
if [ 1 = 1 ] && ! git_conn_check; then
fi
- #echo nb_api_post_host_info "${NAME}.$repo.name" "$name"
+ #echo nb_api_post_host_info "${NAME}.$dir.name" "$name"
echo
echo " >Post repo infos"
(
- nb_api_post_host_info "${NAME}.$repo.name" "$name"
- nb_api_post_host_info "${NAME}.$repo.path" "$repo"
- nb_api_post_host_info "${NAME}.$repo.branch" "$branch"
- nb_api_post_host_info "${NAME}.$repo.url" "$(git remote get-url origin)"
- nb_api_post_host_info "${NAME}.$repo.exit_code" "$(git status --short &> /dev/null; echo $?)"
-# NB 19.02.19 nb_api_post_host_info "${NAME}.$repo" "name:$name branch:$branch"
-# NB 19.02.19 nb_api_post_host_info "${NAME}.$repo.git.status.exit_code" "$(git status --short &> /dev/null; echo $?)"
- # NB 06.02.18 key="repo.$name.$branch"
- # NB 06.02.18 nb_api_post_host_info "${key}.path" "$repo"
- # NB 06.02.18 nb_api_post_host_info "${key}.exit_code" "$ex"
+ preff="git.$dir"
+ nb_api_post_host_info "$preff.name" "$name"
+ nb_api_post_host_info "$preff.path" "$dir"
+ nb_api_post_host_info "$preff.branch" "$branch"
+ nb_api_post_host_info "$preff.url" "$(git remote get-url origin)"
+ nb_api_post_host_info "$preff.exit_code" "$(git status --short &> /dev/null; echo $?)"
+ ) 2>/dev/null | sed -E -e 's/^/ POST /; s/'$'\t''/: /'
echo
- ) 2>/dev/null | sed -E -e 's/^(.)/ POST \1/; s/'$'\t''/: /'
done