From: Nicolas Boisselier Date: Mon, 11 Mar 2019 04:01:06 +0000 (+0000) Subject: bin/nb-update X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=03832beed39197aa8f18b1d53753dbbd1bfa80ae;p=nb.git bin/nb-update --- diff --git a/bin/nb-update b/bin/nb-update index 092671bd..223ffe2f 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -34,9 +34,9 @@ export GIT_SSH="$TMP" 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 @@ -61,7 +61,7 @@ for repo in $(nb_repos); do # # Get user # - user=`ls -dl "$repo/.git" | awk '{print $3}'` + user=`ls -dl "$dir/.git" | awk '{print $3}'` cmd="" @@ -75,9 +75,9 @@ for repo in $(nb_repos); do # # 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 @@ -114,22 +114,18 @@ for repo in $(nb_repos); do 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 diff --git a/etc/dbq/data.php b/etc/dbq/data.php index 6c71e184..8aec03d4 100644 --- a/etc/dbq/data.php +++ b/etc/dbq/data.php @@ -3,7 +3,9 @@ $DBQ['data'] = [ 'tables' => [ 'host_info_err' => [ - 'sql' => "SELECT * FROM host_info WHERE key LIKE '%exit_code' AND val<> '0'", + 'sql' => "SELECT * FROM host_info WHERE 0=1" + ." OR key LIKE '%.exit_code' AND val<> '0'" + , ] ], ];