Guest User

Untitled

a guest
Jan 14th, 2020
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2.  
  3. # Get a list of services which have changed against master
  4. changed=()
  5.  
  6. # Find all the .json files which have been directly updated
  7. while IFS= read -r line; do
  8.     changed+=( "$line" )
  9. done < <( git diff --stat origin/master | grep "builds/.*\.json" | awk '{print $1}' | sed 's/builds\///g;s/\.json//g' )
  10.  
  11. # Find all the playbook yml files which have been directly updated
  12. while IFS= read -r line; do
  13.     changed+=( "$line" )
  14. done < <( git diff --stat origin/master | grep "playbooks" | awk '{print $1}' | sed 's/playbooks\///;s/-playbook.yml//' )
  15.  
  16. #echo ${changed[@]}
  17. for i in "${changed[@]}"; do echo "$i" ; done
RAW Paste Data