You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.4 KiB
64 lines
1.4 KiB
#!/bin/bash
|
|
|
|
### DO NOT EDIT THIS FILE
|
|
|
|
function usage {
|
|
echo
|
|
echoMainTitle "Clone repository"
|
|
echo
|
|
echoSubTitle "Usage:"
|
|
echo
|
|
echo "project-manager git:clone [project-shortname]"
|
|
echo
|
|
echo "--help Prints this message"
|
|
echo
|
|
}
|
|
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &> /dev/null && pwd)/includes/bash_header"
|
|
|
|
url="$(getConfig $shortname "git.url")"
|
|
sshUser="$(getConfig $shortname "git.ssh_user")"
|
|
sshDomain="$(getConfig $shortname "git.ssh_domain")"
|
|
sshPrivateKey="$(getConfig $shortname "git.ssh_private_key")"
|
|
sshPublicKey="$(getConfig $shortname "git.ssh_public_key")"
|
|
sshPrivateKeyPassphrase="$(getCryptedConfig $shortname "git.ssh_private_key_passphrase")"
|
|
|
|
if [ "$url" == "" ]
|
|
then
|
|
echo
|
|
echoError "There is no git url configured"
|
|
echo
|
|
exit
|
|
fi
|
|
|
|
echo
|
|
echoMainTitle "Cloning Repository"
|
|
|
|
echo
|
|
echoSubTitle "Please confirm following data"
|
|
echo
|
|
if [ "$ssh_private_key" != "" ]
|
|
then
|
|
echo "SSH Private Key File: $git_ssh_public_key"
|
|
fi
|
|
if [ "$ssh_public_key" != "" ]
|
|
then
|
|
echo "SSH Public Key File: $git_ssh_public_key"
|
|
fi
|
|
echo "GIT Url: $url"
|
|
echo "GIT User: $ssh_user"
|
|
echo "GIT Domain: $ssh_domain"
|
|
echo "Install Location: $workspaces_dir/$customer/$project"
|
|
echo
|
|
confirm
|
|
|
|
if [ ! -d "$workspaces_dir/$customer/$project" ]
|
|
then
|
|
echo
|
|
echoError "Wprkspace dir not exists"
|
|
echo
|
|
exit
|
|
fi
|
|
|
|
sshAddKey "git"
|
|
git clone "$url" "$workspaces_dir/$customer/$project"
|