From nobody Sat Dec 21 18:35:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1694439853; cv=none; d=zohomail.com; s=zohoarc; b=XDpspnSVNDZWc4E42dvAzVS+OMXLaLt0rLaqX55MvDCn3mnxjFWoDMDUAHxN8JAGB/m2DVayQNI3uuitFazUnHqWlL+PWgQRJEXRIhOWnDfHm74ne7EOHZYLWk7QkPuNhU+H8vHucqq9BWcR7kOIBFlLkHhwUuh2e3P6AekNCjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694439853; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DpQ9wCUHO3M7Ymudn5oW9UEwyR88jkb1D/DZX7C8XFc=; b=muwcNOQB/5owRT6hU8EXwX/L+jgbf1bVBIin6riKlnc9/41BO3tQKgpd47939GQfrH6xGBvsd5PZpE80Q6EN15T2P5qdSVgPBeSbtpq3xN77y45qr28Ct0nS7HKPW1dDK5jLeu/Ft58AV+FRFd2Z0m7eClfF1zK9tP+1fOfPQng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1694439853610884.3084159322746; Mon, 11 Sep 2023 06:44:13 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-30-kJshdnvCPhqd1MoyZuzhYQ-1; Mon, 11 Sep 2023 09:44:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 97BEC28034D0; Mon, 11 Sep 2023 13:43:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C90840C6E70; Mon, 11 Sep 2023 13:43:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E69821946A75; Mon, 11 Sep 2023 13:43:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0A4731946A4C for ; Mon, 11 Sep 2023 13:43:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C9B0420292A8; Mon, 11 Sep 2023 13:43:41 +0000 (UTC) Received: from orca.home.lan (unknown [10.45.225.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 47F562023466; Mon, 11 Sep 2023 13:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694439852; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DpQ9wCUHO3M7Ymudn5oW9UEwyR88jkb1D/DZX7C8XFc=; b=hUEVXFPtjMyrl6aibfkUu8BEV87gZ8iFU1dI++tpuF4Has2PFqZ96nljB8KM+O3ZIdwKBR 4SGRmoRg9pNcKLQAdHtv3PeVfgA2100jfrE43OrMhbVWl9V2lSyTh7cRM9fE8H7gbQCPhV fhGHScZMaYqXj13PR8N/erDKOGagcNw= X-MC-Unique: kJshdnvCPhqd1MoyZuzhYQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH v2 04/35] ci: build.sh: Add a wrapper function executing 'shell' commands Date: Mon, 11 Sep 2023 15:43:05 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Skultety Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1694439855787100003 Content-Type: text/plain; charset="utf-8"; x-default="true" This would normally be not needed at all, but the problem here is the Shell-in-YAML which GitLab interprets. It outputs every command that appears as a line in the 'script' segment in a color-coded fashion for easy identification of problems. Well, that useful feature is lost when there's indirection and one script calls into another in which case it would only output the respective script name which would make failure investigation harder. This simple helper tackles that by echoing the command to be run by any script/function with a color escape sequence so that we don't lose track of the *actual* shell commands being run as part of the GitLab job pipelines. An example of what the output then might look like: [RUN COMMAND]: 'meson compile -C build install-web' Signed-off-by: Erik Skultety Erik Skultety : Reviewed-by: Daniel P. Berrang=C3=A9 --- ci/build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci/build.sh b/ci/build.sh index 7cf07ba5a8..5883542b45 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -27,3 +27,8 @@ meson setup build --werror -Dsystem=3Dtrue $MESON_OPTS $M= ESON_ARGS || \ (cat build/meson-logs/meson-log.txt && exit 1) =20 ninja -C build $NINJA_ARGS + +run_cmd() { + printf "\e[32m[RUN COMMAND]: '%s'\e[0m\n" "$*" + $@ +} --=20 2.41.0