Created
September 25, 2016 20:49
-
-
Save geerlingguy/8bfc668852f44525a01235c8acafc948 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Add a commit and push to origin for each 'geerlingguy.*'' Ansible role. | |
| message="Remove sudo requirement from Travis build." | |
| # Loop through all directories starting with "geerlingguy". | |
| for dir in ./geerlingguy*/ | |
| do | |
| # cd into role directory. | |
| cd "$dir" | |
| # Check if there's a change in the work tree. | |
| if ! git diff --no-ext-diff --quiet --exit-code; then | |
| echo "Change detected in $(basename $(pwd)). Committing and pushing changes." | |
| git commit -a -m "$message" && git push | |
| else | |
| echo "Skipping $(basename $(pwd)) (no changes detected)." | |
| fi | |
| # cd back to parent directory. | |
| cd .. | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment