You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/04 05:26:51 UTC

[GitHub] [ozone] adoroszlai commented on a change in pull request #2479: HDDS-5000. Run CI checks selectively

adoroszlai commented on a change in pull request #2479:
URL: https://github.com/apache/ozone/pull/2479#discussion_r682297447



##########
File path: dev-support/ci/lib/_start_end.sh
##########
@@ -0,0 +1,134 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Starts group for GitHub Actions - makes logs much more readable
+function start_end::group_start {
+    if [[ ${PRINT_INFO_FROM_SCRIPTS} != "false" ]]; then
+        if [[ ${GITHUB_ACTIONS=} == "true" ]]; then
+            echo "::group::${1}"
+        else
+            echo
+            echo "${1}"
+            echo
+        fi
+    fi
+}
+
+# Ends group for GitHub Actions
+function start_end::group_end {
+    if [[ ${PRINT_INFO_FROM_SCRIPTS} != "false" ]]; then
+        if [[ ${GITHUB_ACTIONS=} == "true" ]]; then
+            echo -e "\033[0m"  # Disable any colors set in the group
+            echo "::endgroup::"
+        fi
+    fi
+}
+
+
+#
+# Starts the script.
+# If VERBOSE_COMMANDS variable is set to true, it enables verbose output of commands executed
+# Also prints some useful diagnostics information at start of the script if VERBOSE is set to true
+#
+function start_end::script_start {
+    START_SCRIPT_TIME=$(date +%s)
+    verbosity::print_info "Running '${COLOR_GREEN}$(basename "$0")${COLOR_RESET}'"
+    if [[ "${GITHUB_ACTIONS=}" == "true" &&  ${VERBOSE_COMMANDS:="false"} == "false" ]]; then
+      return
+    fi
+
+    if [[ ${VERBOSE_COMMANDS:="false"} == "true" ]]; then
+        verbosity::print_info
+        verbosity::print_info "${COLOR_BLUE}Variable VERBOSE_COMMANDS Set to \"true\"${COLOR_RESET}"
+        verbosity::print_info "${COLOR_BLUE}You will see a lot of output${COLOR_RESET}"
+        verbosity::print_info
+        set -x
+    else
+        verbosity::print_info "You can increase verbosity by running 'export VERBOSE_COMMANDS=\"true\""
+        if [[ ${SKIP_CACHE_DELETION:=} != "true" ]]; then
+            verbosity::print_info "And skip deleting the output file with 'export SKIP_CACHE_DELETION=\"true\""
+        fi
+        verbosity::print_info
+        set +x
+    fi
+}
+
+function start_end::dump_container_logs() {
+    start_end::group_start "${COLOR_BLUE}Dumping container logs ${container}${COLOR_RESET}"
+    local container="${1}"
+    local dump_file
+    dump_file=${OZONE_SOURCES}/files/container_logs_${container}_$(date "+%Y-%m-%d")_${CI_BUILD_ID}_${CI_JOB_ID}.log
+    echo "${COLOR_BLUE}###########################################################################################${COLOR_RESET}"
+    echo "                   Dumping logs from ${container} container"
+    echo "${COLOR_BLUE}###########################################################################################${COLOR_RESET}"
+    docker_v logs "${container}" > "${dump_file}"

Review comment:
       Thanks.  It is leftover from the original code.  Removed it now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org