Skip to content

Instantly share code, notes, and snippets.

@elefantel
Created March 20, 2017 21:48
Show Gist options
  • Save elefantel/bacb2b5cac1b9b6ebb6156310ec581e9 to your computer and use it in GitHub Desktop.
Save elefantel/bacb2b5cac1b9b6ebb6156310ec581e9 to your computer and use it in GitHub Desktop.
Clone git repositories
#!/bin/bash
clone_encryption_sdk() {
echo '--------------------------------------------------'
echo 'Cloning EncryptionSDK'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/EncryptionSDK.git
}
clone_utilities() {
echo '--------------------------------------------------'
echo 'Cloning UtilitiesModule'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/UtilitiesModule.git
}
clone_routing_sdk() {
echo '--------------------------------------------------'
echo 'Cloning RoutingSDK'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/RoutingSDK.git
}
clone_routing_module() {
echo '--------------------------------------------------'
echo 'Cloning RoutingModule'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/RoutingModule.git
}
clone_portfolio_sdk () {
echo '--------------------------------------------------'
echo 'Cloning PortfolioSDK'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/PortfolioSDK.git
}
clone_portfolio_module() {
echo '--------------------------------------------------'
echo 'Cloning PortfolioModule'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/PortfolioModule.git
}
clone_virtual_bank_app() {
echo '--------------------------------------------------'
echo 'Cloning VirtualBankApp'
echo '--------------------------------------------------'
git clone https://github.com/XYCompany/VirtualBankApp.git
}
clone_all() {
echo '--------------------------------------------------'
echo 'Cloning All Repositories'
echo '--------------------------------------------------'
clone_encryption_sdk && clone_routing_sdk && clone_routing_sdk && clone_routing_module && clone_portfolio_sdk && clone_portfolio_module && clone_virtual_bank_app
}
#loop through commandline arguments arguments
for i in "$@"; do
if [ "$i" = "encrypt" ]
then
clone_encryption_sdk
elif [ "$i" = "utilities" ]
then
clone_utilities
elif [ "$i" = "routingsdk" ]
then
clone_routing_sdk
elif [ "$i" = "routingmodule" ]
then
clone_routing_module
elif [ "$i" = "portfoliosdk" ]
then
clone_portfolio_sdk
elif [ "$i" = "portfoliomodule" ]
then
clone_portfolio_module
elif [ "$i" = "app" ]
then
clone_virtual_bank_app
elif [ "$i" = "all" ]
then
clone_all
else
echo "====== ERROR: Incorrect Module Code ======"
echo "====== Valid (Code = Module) argument ======"
echo "encrypt: EncryptionSDK"
echo "utilities: UtilitiesModule"
echo "routingsdk: RoutingSDK"
echo "routingmodule: RoutingModule"
echo "portfoliosdk: PortfolioSDK"
echo "portfoliomodule: PortfolioModule"
echo "app: VirtualBankApp"
echo "all: All Modules"
fi
done
if [[ $# -eq 0 ]]
then
echo "====== ERROR: No Module Code Entered ======"
echo "====== Valid Build (Code = Module) argument: ======"
echo "encrypt: EncryptionSDK"
echo "utilities: UtilitiesModule"
echo "routingsdk: RoutingSDK"
echo "routingmodule: RoutingModule"
echo "portfoliosdk: PortfolioSDK"
echo "portfoliomodule: PortfolioModule"
echo "app: VirtualBankApp"
echo "all: All Modules"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment