From nobody Mon Nov 25 07:32:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1610637361; cv=none; d=zohomail.com; s=zohoarc; b=mgU72/602wh3E+08PwP8jTR/MsvM8q2B+M+H5Ow5oNO32e7HsznzzBYiGPsfXCXgUZZE2PSvFv5b8uQFmkY5LyzQWU6C5Q7LccSQNmBxiLfYYbSbsZNCOhpLMvzmiXVkp/f7CWRU8E4uokLmMUmRmU/BwO4/mA4n+4F6Q4KHDDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610637361; 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=2LW/ezHtIP/pqT1WWj7FUMCGRk7ybspLwKMpXivi6XM=; b=bTVkR3Y5njjh0Jny9wrcaWU/VhWvF0ZpxDx5Vwjri3gDVVT/kv5tVkXflVp9GtSlToaozxzbUpd+ZKvvh5f5U/gFbgAKN0RllYn3flrGhScYl2UlKtd0m/Wj/fMkcTJzqK0JVKhEnq2WkKIssGoTG4edGeBkfkwEyxoQy4zwMHM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1610637361366324.9193992259318; Thu, 14 Jan 2021 07:16:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-0aqsDTI1OYewAPHDxCBVyg-1; Thu, 14 Jan 2021 10:15:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 075E1192299F; Thu, 14 Jan 2021 15:15:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 584F6764D5; Thu, 14 Jan 2021 15:15:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 11CEA5002D; Thu, 14 Jan 2021 15:15:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10EFFmAX032722 for ; Thu, 14 Jan 2021 10:15:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 31C6776201; Thu, 14 Jan 2021 15:15:48 +0000 (UTC) Received: from nautilus.local (unknown [10.40.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67BE8764D8; Thu, 14 Jan 2021 15:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610637360; 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=2LW/ezHtIP/pqT1WWj7FUMCGRk7ybspLwKMpXivi6XM=; b=OxIcaFsy1OOlhUyf9mBGDmOYYeq/ol3RT3r/VlXMrA/mmNIUT5DmtoTNd0X9If7yCIAYVI Ely+AqgY/aXpcAEDDt0sKbM6YtkFWG76nBZQfKkORzBOUgyM6T9XmcP6ZCL8G8NU2wb/Xm Kq2IF5nGrQOz+9ZMoqoF238hYXx10WY= X-MC-Unique: 0aqsDTI1OYewAPHDxCBVyg-1 From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH v3 2/3] gitlab-ci.yml: Convert only/except to the rules syntax Date: Thu, 14 Jan 2021 16:15:10 +0100 Message-Id: <859e5060c4f50f8afed6f5485ec80e60bb3ae3dc.1610637247.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: eskultet@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 'rules' syntax replaces the only/except syntax with which it is mutually exclusive. In some cases the 'rules' syntax is more readable than the 'only/except' equivalent, in some cases it is not. The idea behind this conversion is to introduce an explicit env variable controlling the 'allow_failure' attribute which would then be attached to a broken build job which would in turn result in a soft failure. Such behaviour is not possible to achieve with the older 'only/except' syntax. Signed-off-by: Erik Skultety --- .gitlab-ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eefcef526b..7636544ee1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,8 @@ stages: needs: [] services: - docker:dind + rules: + - when: on_success before_script: - export TAG=3D"$CI_REGISTRY_IMAGE/ci-$NAME:latest" - export COMMON_TAG=3D"$CI_REGISTRY/libvirt/libvirt/ci-$NAME:latest" @@ -43,6 +45,8 @@ stages: .native_build_job: stage: builds image: $CI_REGISTRY_IMAGE/ci-$NAME:latest + rules: + - when: on_success cache: paths: - ccache/ @@ -98,10 +102,8 @@ stages: ci/cirrus/$NAME.yml - cat ci/cirrus/$NAME.yml - cirrus-run -v --show-build-log always ci/cirrus/$NAME.yml - only: - variables: - - $CIRRUS_GITHUB_REPO - - $CIRRUS_API_TOKEN + rules: + - if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN" =20 .cross_build_job: stage: builds @@ -110,6 +112,8 @@ stages: paths: - ccache/ key: "$CI_JOB_NAME" + rules: + - when: on_success before_script: - *script_variables script: @@ -552,8 +556,8 @@ potfile: image: $CI_REGISTRY_IMAGE/ci-centos-8:latest needs: - x64-centos-8-container - only: - - master + rules: + - if: "$CI_COMMIT_BRANCH =3D=3D 'master'" before_script: - *script_variables script: @@ -580,9 +584,8 @@ check-dco: image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master script: - /check-dco - except: - variables: - - $CI_PROJECT_NAMESPACE =3D=3D 'libvirt' + rules: + - if: "$CI_PROJECT_NAMESPACE !=3D 'libvirt'" variables: GIT_DEPTH: 1000 =20 @@ -600,8 +603,5 @@ coverity: - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C build - tar cfz cov-int.tar.gz cov-int - curl https://scan.coverity.com/builds?project=3D$COVERITY_SCAN_PROJE= CT_NAME --form token=3D$COVERITY_SCAN_TOKEN --form email=3D$GITLAB_USER_EMA= IL --form file=3D@cov-int.tar.gz --form version=3D"$(git describe --tags)" = --form description=3D"$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMI= T_REF_NAME:$CI_PIPELINE_ID" - only: - refs: - - schedules - variables: - - $COVERITY_SCAN_PROJECT_NAME && $COVERITY_SCAN_TOKEN + rules: + - if: "$CI_PIPELINE_SOURCE =3D=3D 'schedule' && $COVERITY_SCAN_PROJECT= _NAME && $COVERITY_SCAN_TOKEN" --=20 2.29.2