-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added script to travis build to run tab exterminator script on PRs an…
…d push changes
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
set -e # Exit with nonzero exit code if anything fails | ||
|
||
# Save some useful information | ||
REPO=`git config remote.origin.url` | ||
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} | ||
|
||
# Add rsa keys to the ssh agent to push to GitHub | ||
gpg --output ../id_maestro_rsa --batch --passphrase $DECRYPT_GITHUB_AUTH --decrypt id_maestro_rsa.enc | ||
chmod 600 ../id_maestro_rsa | ||
eval `ssh-agent -s` | ||
ssh-add ../id_maestro_rsa | ||
#ls ../id_rsa_travis | ||
|
||
echo "Running tab exterminator script" | ||
|
||
cd $TRAVIS_BUILD_DIR/Util/code_checker | ||
./tab_exterminator.sh | ||
|
||
# Now let's go have some fun with the cloned repo | ||
cd $TRAVIS_BUILD_DIR | ||
git config user.name "Travis CI" | ||
git config user.email "$COMMIT_AUTHOR_EMAIL" | ||
|
||
echo "doing git add/commit/push" | ||
|
||
# Commit the "changes", i.e. the new version. | ||
# The delta will show diffs between new and old versions. | ||
git add --all | ||
|
||
# Exit if there are no docs changes | ||
if git diff --staged --quiet; then | ||
echo "exiting with no changes" | ||
exit 0 | ||
fi | ||
|
||
# Otherwise, commit and push | ||
git commit -m "Tabs have been converted to spaces by tab_exterminator.sh" | ||
git push $SSH_REPO $TRAVIS_PULL_REQUEST_BRANCH | ||
cd | ||
|
||
# Kill the ssh-agent | ||
ssh-agent -k |