-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from rackspace-infrastructure-automation/jp/ssh…
…-spike fetch origin from github.com forcing regular ssh keys
- Loading branch information
Showing
5 changed files
with
34 additions
and
21 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env sh | ||
set -eu | ||
|
||
# be sure branch is up to date | ||
git fetch origin | ||
|
||
# in the last hundred commits, is one of the parents in the current master? | ||
if ! (git log --pretty=format:'%H' -n 100 | grep -q "$(git rev-parse remotes/origin/master)"); then | ||
echo >&2 'Your branch is not up to date. Exiting.' | ||
exit 1 | ||
fi | ||
echo >&2 'Calling check_old.sh explicitly is not required anymore.' | ||
echo >&2 'Feel free to remove it from your build pipeline.' |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
#!/usr/bin/env sh | ||
set -eu | ||
|
||
. $(dirname $(realpath $0))/variables.sh | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
#!/usr/bin/env sh | ||
set -eu | ||
|
||
. $(dirname $(realpath $0))/variables.sh | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,27 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env sh | ||
set -eu | ||
|
||
set -e | ||
check_old() { | ||
local fake_hostname='github.com.original.invalid' | ||
# avoid overridden ssh config for github.com | ||
if ! (ssh -G $fake_hostname | grep -q '^hostname github.com$'); then | ||
echo "Host ${fake_hostname}" >> ~/.ssh/config | ||
echo ' HostName github.com' >> ~/.ssh/config | ||
fi | ||
|
||
# be sure branch is up to date | ||
git fetch --quiet --depth 100 $(git config --get remote.origin.url | sed "s/[email protected]:/git@${fake_hostname}:/") | ||
|
||
# in the last hundred commits, is one of the parents in the current master? | ||
if ! (git log --pretty=format:'%H' -n 100 | grep -q "$(git rev-parse remotes/origin/master)"); then | ||
echo >&2 'Your branch is not up to date. Exiting...' | ||
exit 1 | ||
else | ||
echo 'Your branch is up to date. Proceeding...' | ||
fi | ||
} | ||
|
||
check_old | ||
|
||
# standard paths | ||
MASTER_REF=$(git rev-parse remotes/origin/master) | ||
|