diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2021-10-28 13:12:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 13:12:44 -0400 |
commit | 7eb25b2ff51bc7c40a4886c23ac97fb295f242cf (patch) | |
tree | f4e43a855ef12d45cdcbd041d6a8c85df773f01a /netdata-installer.sh | |
parent | c7a16dc75c4af1e05a6eab3d92c10fe9f4c49a48 (diff) |
Add log grouping in installer and static build code when running under GitHub Actions. (#11720)
* Add log grouping in installer code when running under GitHub Actions.
This will make our CI logs much easier to understand.
* Add log grouping to static build process.
* Use oneliner style group commands in netdata-installer.sh
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-x | netdata-installer.sh | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh index aaba0130a7..8f057add03 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -598,6 +598,8 @@ bundle_libmosquitto() { return 0 fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling libmosquitto." + progress "Prepare custom libmosquitto version" MOSQUITTO_PACKAGE_VERSION="$(cat packaging/mosquitto.version)" @@ -623,6 +625,8 @@ bundle_libmosquitto() { run_failed "Unable to fetch sources for libmosquitto." defer_error_highlighted "Unable to fetch sources for libmosquitto. You will not be able to connect this node to Netdata Cloud." fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } bundle_libmosquitto @@ -698,6 +702,8 @@ bundle_libwebsockets() { return 0 fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling libwebsockets." + progress "Prepare libwebsockets" LIBWEBSOCKETS_PACKAGE_VERSION="$(cat packaging/libwebsockets.version)" @@ -724,6 +730,8 @@ bundle_libwebsockets() { run_failed "Unable to fetch sources for libwebsockets." defer_error_highlighted "Unable to fetch sources for libwebsockets. You may not be able to connect this node to Netdata Cloud." fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } bundle_libwebsockets @@ -770,6 +778,8 @@ bundle_protobuf() { return 0 fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling protobuf." + PROTOBUF_PACKAGE_VERSION="$(cat packaging/protobuf.version)" tmp="$(mktemp -d -t netdata-protobuf-XXXXXX)" @@ -794,6 +804,8 @@ bundle_protobuf() { run_failed "Unable to fetch sources for protobuf." defer_error_highlighted "Unable to fetch sources for protobuf. You may not be able to connect this node to Netdata Cloud." fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } bundle_protobuf @@ -848,6 +860,8 @@ bundle_judy() { progress "/usr/include/Judy.h does not exist, but we need libJudy, building our own copy" fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling libJudy." + progress "Prepare libJudy" JUDY_PACKAGE_VERSION="$(cat packaging/judy.version)" @@ -869,6 +883,8 @@ bundle_judy() { else run_failed "Failed to build libJudy." if [ -n "${NETDATA_BUILD_JUDY}" ]; then + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" + exit 1 else defer_error_highlighted "Failed to build libJudy. dbengine support will be disabled." @@ -877,11 +893,15 @@ bundle_judy() { else run_failed "Unable to fetch sources for libJudy." if [ -n "${NETDATA_BUILD_JUDY}" ]; then + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" + exit 1 else defer_error_highlighted "Unable to fetch sources for libJudy. dbengine support will be disabled." fi fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } bundle_judy @@ -922,6 +942,8 @@ bundle_jsonc() { return 0 fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling JSON-C." + progress "Prepare JSON-C" JSONC_PACKAGE_VERSION="$(cat packaging/jsonc.version)" @@ -947,6 +969,8 @@ bundle_jsonc() { run_failed "Unable to fetch sources for JSON-C." defer_error_highlighted "Unable to fetch sources for JSON-C. Netdata Cloud support will be disabled." fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } bundle_jsonc @@ -999,6 +1023,8 @@ bundle_libbpf() { return 0 fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling libbpf." + rename_libbpf_packaging progress "Prepare libbpf" @@ -1034,6 +1060,8 @@ bundle_libbpf() { defer_error_highlighted "Unable to fetch sources for libbpf. You may not be able to use eBPF plugin." fi fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } bundle_libbpf @@ -1059,6 +1087,8 @@ fi # ----------------------------------------------------------------------------- echo >&2 + +[ -n "${GITHUB_ACTIONS}" ] && echo "::group::Configuring Netdata." progress "Run autotools to configure the build environment" if [ "$have_autotools" ]; then @@ -1077,10 +1107,14 @@ run ./configure \ ${NETDATA_CONFIGURE_OPTIONS} \ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || exit 1 +[ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" + # remove the build_error hook trap - EXIT # ----------------------------------------------------------------------------- +[ -n "${GITHUB_ACTIONS}" ] && echo "::group::Building Netdata." + progress "Cleanup compilation directory" run $make clean @@ -1090,7 +1124,11 @@ progress "Compile netdata" run $make ${MAKEOPTS} || exit 1 +[ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" + # ----------------------------------------------------------------------------- +[ -n "${GITHUB_ACTIONS}" ] && echo "::group::Installing Netdata." + progress "Migrate configuration files for node.d.plugin and charts.d.plugin" # migrate existing configuration files @@ -1450,6 +1488,8 @@ else run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type d -exec chmod 0755 {} \; fi +[ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" + # ----------------------------------------------------------------------------- # govercomp compares go.d.plugin versions. Exit codes: @@ -1517,6 +1557,8 @@ install_go() { return 0 fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Installing go.d.plugin." + # When updating this value, ensure correct checksums in packaging/go.d.checksums GO_PACKAGE_VERSION="$(cat packaging/go.d.version)" ARCH_MAP=( @@ -1564,6 +1606,7 @@ install_go() { defer_error "go.d plugin download failed, go.d plugin will not be available" echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer" echo >&2 + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" return 0 fi @@ -1579,6 +1622,7 @@ install_go() { run_failed "go.d.plugin package files checksum validation failed." defer_error "go.d.plugin package files checksum validation failed, go.d.plugin will not be available" + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" return 0 fi @@ -1595,7 +1639,8 @@ install_go() { fi run chmod 0750 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin" rm -rf "${tmp}" - return 0 + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } install_go @@ -1688,6 +1733,8 @@ install_ebpf() { return 0 fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Installing eBPF code." + remove_old_ebpf progress "Installing eBPF plugin" @@ -1708,6 +1755,8 @@ install_ebpf() { run_failed "Failed to download eBPF collector package" echo 2>&" Removing temporary directory ${tmp} ..." rm -rf "${tmp}" + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" return 1 fi @@ -1722,6 +1771,8 @@ install_ebpf() { RET=$? if [ "${RET}" != "0" ]; then rm -rf "${tmp}" + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" return 1 fi fi @@ -1730,7 +1781,7 @@ install_ebpf() { rm -rf "${tmp}" - return 0 + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" } progress "eBPF Kernel Collector" |