blob: e7e83ea90c369c59ba0c0d1ffc2311b0edec1559 [file] [log] [blame]
Ales Komarek1b373112017-08-08 08:48:56 +02001#!/bin/bash
2# source: https://gist.github.com/epcim/e488af8be69b616eab3088a14a937e14
3
4# Aggregate succeeded/failed/changes per node on a dry run.
5
6salt \* state.apply --out=json --static test=true -b15 | jq -r 'to_entries | map({ key:.key, value: { total: [.value[]]|length ,
7 succeed: [.value[]|select(.result == true)]|length,
8 failed: [.value[]|select(.result == false)]|length,
9 changes: [select(.value[].changes|length > 0)]|length } }) | from_entries ' |\
10 tee trend_$(date "+%Y-%m-%d-%s").json
11
12# to review
13ls trend*.json| sort |tail -n2 |xargs -n2 diff -y | colordiff