|
@ -8,7 +8,7 @@ function usage { |
|
|
echo |
|
|
echo |
|
|
echoSubTitle "Usage:" |
|
|
echoSubTitle "Usage:" |
|
|
echo |
|
|
echo |
|
|
echo "project-manager git:clone [project-shortname]" |
|
|
|
|
|
|
|
|
echo "project-manager git:clone [shortname] [git-name]" |
|
|
echo |
|
|
echo |
|
|
echo "--help Prints this message" |
|
|
echo "--help Prints this message" |
|
|
echo |
|
|
echo |
|
@ -16,12 +16,10 @@ function usage { |
|
|
|
|
|
|
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &> /dev/null && pwd)/includes/bash_header" |
|
|
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")" |
|
|
|
|
|
|
|
|
gitName="$(getArgument "$2" "Git name required" true)" |
|
|
|
|
|
escapedGitName=${gitName//./\\.} |
|
|
|
|
|
url="$(getConfig "$shortname" "git.repositories.$escapedGitName.url")" |
|
|
|
|
|
ssh="$(getConfig "$shortname" "git.repositories.$escapedGitName.ssh")" |
|
|
workspaces_dir="$(getConfig false "project_manager.workspaces_dir")" |
|
|
workspaces_dir="$(getConfig false "project_manager.workspaces_dir")" |
|
|
|
|
|
|
|
|
if [ "$url" == "" ] |
|
|
if [ "$url" == "" ] |
|
@ -38,17 +36,8 @@ echoMainTitle "Cloning Repository" |
|
|
echo |
|
|
echo |
|
|
echoSubTitle "Please confirm following data" |
|
|
echoSubTitle "Please confirm following data" |
|
|
echo |
|
|
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 Url: $url" |
|
|
echo "GIT User: $ssh_user" |
|
|
|
|
|
echo "GIT Domain: $ssh_domain" |
|
|
|
|
|
echo "Install Location: $workspaces_dir/$customer/$project" |
|
|
echo "Install Location: $workspaces_dir/$customer/$project" |
|
|
echo |
|
|
echo |
|
|
confirm |
|
|
confirm |
|
@ -58,4 +47,5 @@ then |
|
|
mkdir -p "$workspaces_dir/$customer/$project" |
|
|
mkdir -p "$workspaces_dir/$customer/$project" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
sshAdd "$shortname" "$ssh" |
|
|
git clone "$url" "$workspaces_dir/$customer/$project" |
|
|
git clone "$url" "$workspaces_dir/$customer/$project" |