-
Notifications
You must be signed in to change notification settings - Fork 311
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 #147 in SWDEV/franka_ros from feature/SRR-1183-jen…
…kins-script-must-fail-when-internal to develop * commit 'f8506671ea911c35f6c5794d8d8a7c326f903f20': Modified checkgithistory to accept parameters and fixed typos in comment Checking github history sync in separate jenkins stage and removed unused dependency from dockerfile Add: bash script to check sync between local and public repos
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# the script checks if the public repo and the local repo commit history are sync, otherwise it fails | ||
if [ $# -ne 2 ]; then | ||
>&2 echo "Not enough argument supplied. Usage: checkgithistory.sh public_url develop_branch_name" | ||
exit 1 | ||
fi | ||
|
||
cd src/franka_ros | ||
public_url=$1 | ||
public_remote_name=$(git remote -v | grep ${public_url} | head -n 1 | sed -e 's/\s.*$//') | ||
develop_branch_name=$2 | ||
|
||
if [ -z "$public_remote_name" ]; then | ||
public_remote_name="public" | ||
git remote add $public_remote_name $public_url | ||
fi | ||
|
||
git fetch $public_remote_name | ||
|
||
local_commit_hash=$(git rev-parse origin/${develop_branch_name}) | ||
public_commit_hash=$(git rev-parse ${public_remote_name}/${develop_branch_name}) | ||
|
||
if [ "$local_commit_hash" != "$public_commit_hash" ]; then | ||
>&2 echo "Local and public commit hashes do not match. Please update local to the latest public commit" | ||
exit 1 | ||
else | ||
echo "Local and public commit hashes do match." | ||
fi |
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