#!/bin/bash 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 "$project_manager_dir/bin/includes/project_header" gitValidate help="$(getParameter "--help" false "$@")" if [ "$help" == true ] || [ "$1" == "" ] then usage exit fi if [ "$git_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 [ "$git_ssh_private_key" != "" ] then echo "SSH Private Key File: $git_ssh_public_key" fi if [ "$git_ssh_public_key" != "" ] then echo "SSH Public Key File: $git_ssh_public_key" fi echo "GIT Url: $git_url" echo "GIT User: $git_ssh_user" echo "GIT Domain: $git_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 "$git_url" "$workspaces_dir/$customer/$project" echo echoSuccess "GIT cloned" echo