Skip to content

Commit

Permalink
update git-update
Browse files Browse the repository at this point in the history
  • Loading branch information
matejcikm committed Jan 24, 2020
1 parent f67e5af commit 1780ce0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion git-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,26 @@ SOURCE_BRANCH=$2
DESTINATION_REPO="$3"
DESTINATION_BRANCH="$4"

GIT_SSH_COMMAND="ssh -v"
if ! echo $SOURCE_REPO | grep '.git'
then
if [[ -n "$SSH_PRIVATE_KEY" ]]
then
SOURCE_REPO="[email protected]:${SOURCE_REPO}.git"
GIT_SSH_COMMAND="ssh -v"
else
SOURCE_REPO="https://github.com/${SOURCE_REPO}.git"
fi
fi
if ! echo $DESTINATION_REPO | grep '.git'
then
if [[ -n "$SSH_PRIVATE_KEY" ]]
then
DESTINATION_REPO="[email protected]:${DESTINATION_REPO}.git"
GIT_SSH_COMMAND="ssh -v"
else
DESTINATION_REPO="https://github.com/${DESTINATION_REPO}.git"
fi
fi

echo "SOURCE=$SOURCE_REPO:$SOURCE_BRANCH"
echo "DESTINATION=$DESTINATION_REPO:$DESTINATION_BRANCH"
Expand Down

0 comments on commit 1780ce0

Please sign in to comment.