From cfedd52600102053601830b71f416aff95e0cc31 Mon Sep 17 00:00:00 2001
From: Melanie Plageman <melanieplageman@gmail.com>
Date: Fri, 19 Nov 2021 16:20:01 -0500
Subject: [PATCH] use anchors and aliases

---
 .cirrus.yml | 56 ++++++++++++++---------------------------------------
 1 file changed, 15 insertions(+), 41 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index b3321a91ae..439ed55d0e 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,3 +1,14 @@
+on_failure: &on_failure
+  log_artifacts:
+    path: "**/**.log"
+    type: text/plain
+  regress_diffs_artifacts:
+    path: "**/**.diffs"
+    type: text/plain
+  tap_artifacts:
+    path: "**/regress_log_*"
+    type: text/plain
+
 env:
   # accelerate initial clone, but a bit of depth so that concurrent tasks work
   CIRRUS_CLONE_DEPTH: 100
@@ -68,22 +79,13 @@ task:
     - su postgres -c 'time gmake -s -j2 ${CHECK} ${CHECKFLAGS}'
 
   on_failure:
+    <<: *on_failure
     cores_script: |
       for corefile in $(find /tmp -name '*.core' 2>/dev/null) ; do
         binary=$(gdb -quiet -core $corefile -batch -ex 'info auxv' | grep AT_EXECPATH | perl -pe "s/^.*\"(.*)\"\$/\$1/g") ;
         echo dumping $corefile for $binary ;
         gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" $binary $corefile;
       done
-    log_artifacts:
-      path: "**/**.log"
-      type: text/plain
-    regress_diffs_artifacts:
-      path: "**/**.diffs"
-      type: text/plain
-    tap_artifacts:
-      path: "**/regress_log_*"
-      type: text/plain
-
 
 task:
   name: Linux
@@ -153,22 +155,13 @@ task:
       '
 
   on_failure:
+    <<: *on_failure
     cores_script: |
       for corefile in $(find /tmp -name '*.core' 2>/dev/null) ; do
         binary=$(gdb -quiet -core $corefile -batch -ex 'info auxv' | grep AT_EXECFN | perl -pe "s/^.*\"(.*)\"\$/\$1/g") ;
         echo dumping $corefile for $binary ;
         gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" $binary $corefile ;
       done
-    log_artifacts:
-      path: "**/**.log"
-      type: text/plain
-    regress_diffs_artifacts:
-      path: "**/**.diffs"
-      type: text/plain
-    tap_artifacts:
-      path: "**/regress_log_*"
-      type: text/plain
-
 
 task:
   name: macOS
@@ -252,20 +245,11 @@ task:
     - gmake -s -j12 ${CHECK} ${CHECKFLAGS}
 
   on_failure:
+    <<: *on_failure
     cores_script: |
       for corefile in $(find /cores/ -name 'core.*' 2>/dev/null) ; do
         lldb -c $corefile --batch -o 'thread backtrace all' -o 'quit' ;
       done
-    log_artifacts:
-      path: "**/**.log"
-      type: text/plain
-    regress_diffs_artifacts:
-      path: "**/**.diffs"
-      type: text/plain
-    tap_artifacts:
-      path: "**/regress_log_*"
-      type: text/plain
-
 
 task:
   name: Windows
@@ -337,17 +321,7 @@ task:
     - cd src\tools\msvc
     - perl vcregress.pl ecpgcheck
 
-  on_failure:
-    log_artifacts:
-      path: "**/**.log"
-      type: text/plain
-    regress_diffs_artifacts:
-      path: "**/**.diffs"
-      type: text/plain
-    tap_artifacts:
-      path: "**/regress_log_*"
-      type: text/plain
-
+  on_failure: *on_failure
 
 task:
   name: CompilerWarnings
-- 
2.32.0

