Skip to content

Commit 8289e1a

Browse files
committed
update ci.sh
1 parent 42e049c commit 8289e1a

1 file changed

Lines changed: 140 additions & 19 deletions

File tree

ci/ci.sh

Lines changed: 140 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,22 @@ build-publish-providers() { build-publish-children providers; }
132132
build-publish-tests() { build-publish-children tests; }
133133
build-publish-examples() { build-publish-children examples; }
134134
build-publish-children() {
135-
local sm d f
135+
local sm d f subdir
136136
local which="$1"
137137
if [ "$which" = "all" ]; then
138138
pub-main
139-
pub-child codecs
140-
pub-child providers
141-
# pub-child tests
142-
# pub-child examples
139+
# inspecting possible chilren directories for golang submodules
140+
for subdir in codecs providers \
141+
lite local \
142+
service pgsqlogger shellmode; do
143+
[ -d $subdir ] && pub-child $subdir
144+
done
145+
# [ -d codecs ] && pub-child codecs
146+
# [ -d codecs ] && pub-child providers
147+
# # pub-child tests
148+
# # pub-child examples
149+
# [ -d lite ] && pub-child lite
150+
# [ -d local ] && pub-child local
143151
else
144152
for sm in $which; do
145153
for f in $(find ./$sm -type f -iname 'go.mod' -print); do
@@ -303,27 +311,41 @@ pub-child() {
303311
# fi
304312

305313
if [ "$ver" = "" ]; then
306-
echo "version tag not found, add doc.go and Version=\"1.0.0\" and retry."
314+
err "version tag not found / dir = $which"
315+
echo " add doc.go and version=\"1.0.0\" and retry."
307316
else
308317
ver="$(eval echo $ver)"
309-
echo "ver=$ver found"
318+
# echo "ver=$ver found"
319+
tip " entering $which | using ver=$ver ..."
310320
for sm in $which; do
311321
for f in $(find ./$sm -type f -iname 'go.mod' -print); do
312322
d="$(dirname "$f")"
313323
if [ -d "$d" ]; then
314-
# do-update-dep "$d"
315-
# commit-submodule "$d"
316-
echo " - publishing $d "
317-
local pre="${d/.\//}"
318-
pushd "$d" >/dev/null
319-
if is_git_dirty; then
320-
echo "repo is dirty, nothing to do before the changes are reviewed."
321-
else
322-
$ECHO git tag "$pre/$ver"
323-
$ECHO
324+
if [[ ! "$d" == */test ]]; then
325+
# do-update-dep "$d"
326+
# commit-submodule "$d"
327+
local pre="${d/.\//}"
328+
local tag="$pre/$ver"
329+
tip " - publishing $clr_invert$d$clr_reset_invert with tag $clr_underline$pre/$ver$clr_reset_underline."
330+
pushd "$d" >/dev/null
331+
if is_git_dirty; then
332+
wrn "repo is DIRTY, nothing to do before the changes are reviewed."
333+
else
334+
$ECHO git tag "$pre/$ver"
335+
$ECHO
336+
fi
337+
popd >/dev/null
324338
fi
325-
popd >/dev/null
326339
fi
340+
341+
# d="$(dirname "$f")"
342+
# if [[ ! "$d" == */test ]]; then
343+
# if [ -d "$d" ]; then
344+
# do-update-dep "$d"
345+
# commit-submodule "$d"
346+
# fi
347+
# fi
348+
327349
done
328350
done
329351
fi
@@ -587,14 +609,113 @@ is_git_dirty() {
587609
fi
588610
}
589611

612+
# effects
613+
clr_reset_all="\e[0m"
614+
clr_bold="\e[1m"
615+
clr_dim="\e[2m"
616+
clr_italic="\e[3m"
617+
clr_underline="\e[4m"
618+
clr_blink="\e[5m"
619+
clr_rapic_blink="\e[6m"
620+
clr_invert="\e[7m"
621+
clr_hide="\e[8m"
622+
clr_strike="\e[9m"
623+
# reset effects
624+
clr_reset_bold="\e[21m"
625+
clr_reset_dim="\e[22m"
626+
clr_reset_italic="\e[23m"
627+
clr_reset_underline="\e[24m"
628+
clr_reset_blink="\e[25m"
629+
clr_reset_spacing="\e[26m"
630+
clr_reset_invert="\e[27m"
631+
clr_reset_hide="\e[28m"
632+
clr_reset_crossout="\e[29m"
633+
# 16-color fg
634+
black='30'
635+
red='31'
636+
green='32'
637+
yellow='33'
638+
blue='34'
639+
megenta='35'
640+
cyan='36'
641+
white='37'
642+
# 16-color bright fg
643+
bright_black='90'
644+
bright_red='91'
645+
bright_green='92'
646+
bright_yellow='93'
647+
bright_blue='94'
648+
bright_megenta='95'
649+
bright_cyan='96'
650+
bright_white='97'
651+
# 16-color bg
652+
bg_black='40'
653+
bg_red='41'
654+
bg_green='42'
655+
bg_yellow='43'
656+
bg_blue='44'
657+
bg_megenta='45'
658+
bg_cyan='46'
659+
bg_white='47'
660+
# 16-color bright bg
661+
bg_bright_black='100'
662+
bg_bright_red='101'
663+
bg_bright_green='102'
664+
bg_bright_yellow='103'
665+
bg_bright_blue='104'
666+
bg_bright_megenta='105'
667+
bg_bright_cyan='106'
668+
bg_bright_white='107'
669+
#
590670
headline() { printf "\e[0;1m$@\e[0m:\n"; }
591671
headline_begin() { printf "\e[0;1m"; } # for more color, see: shttps://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
592672
headline_end() { printf "\e[0m:\n"; } # https://misc.flogisoft.com/bash/tip_colors_and_formatting
593-
debug() { in_debug && printf "\e[0;38;2;133;133;133m$@\e[0m\n" || :; }
673+
debug() { ((DEBUG)) && printf "\e[0;38;2;133;133;133m$@\e[0m\n" || :; }
594674
debug_begin() { printf "\e[0;38;2;133;133;133m"; }
595675
debug_end() { printf "\e[0m\n"; }
676+
println16() { # eg: println16 31 "hello"
677+
local clr="${1:-31}" && (($#)) && shift
678+
printf "\e[${clr}m$@\e[0m\n"
679+
}
680+
println256() { # eg: println256 255 "hello"
681+
local byte="${1:-128}" && (($#)) && shift
682+
printf "\e[38;5;${byte}m$@\e[0m\n"
683+
}
684+
printlnrgb() { # eg: printlnrgb 133 133 133 "hello"
685+
local r="${1:-128}" && (($#)) && shift
686+
local g="${1:-128}" && (($#)) && shift
687+
local b="${1:-128}" && (($#)) && shift
688+
printf "\e[38;2;${r};${g};${b}m$@\e[0m\n"
689+
}
690+
printlnrgb_special() {
691+
local r="${1:-128}" && (($#)) && shift
692+
local g="${1:-128}" && (($#)) && shift
693+
local b="${1:-128}" && (($#)) && shift
694+
printf "\e[38;0;${r};${g};${b}m$@\e[0m\n"
695+
}
696+
printlnrgb_transparent() {
697+
local r="${1:-128}" && (($#)) && shift
698+
local g="${1:-128}" && (($#)) && shift
699+
local b="${1:-128}" && (($#)) && shift
700+
printf "\e[38;1;${r};${g};${b}m$@\e[0m\n"
701+
}
702+
printlnrgb_cmy() {
703+
local cs="${1:-128}" && (($#)) && shift
704+
local r="${1:-128}" && (($#)) && shift
705+
local g="${1:-128}" && (($#)) && shift
706+
local b="${1:-128}" && (($#)) && shift
707+
printf "\e[38;3;${r};${g};${b};${cs}m$@\e[0m\n"
708+
}
709+
printlnrgb_cmyb() {
710+
local cs="${1:-128}" && (($#)) && shift
711+
local r="${1:-128}" && (($#)) && shift
712+
local g="${1:-128}" && (($#)) && shift
713+
local b="${1:-128}" && (($#)) && shift
714+
printf "\e[38;4;${r};${g};${b};${cs}m$@\e[0m\n"
715+
}
596716
dbg() { ((DEBUG)) && printf ">>> \e[0;38;2;133;133;133m$@\e[0m\n" || :; }
597717
tip() { printf "\e[0;38;2;133;133;133m>>> $@\e[0m\n"; }
718+
wrn() { printf "\e[0;38;2;172;172;22m... [WARN] \e[0;38;2;11;11;11m$@\e[0m\n"; }
598719
err() { printf "\e[0;33;1;133;133;133m>>> $@\e[0m\n" 1>&2; }
599720
mvif() {
600721
local src="$1" dstdir="$2"

0 commit comments

Comments
 (0)