first
This commit is contained in:
9
fun.sh
Normal file
9
fun.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
#
|
||||||
|
#for branch in $(git for-each-ref --format='%(refname)' refs/heads/); do
|
||||||
|
# echo "${branch/'refs/heads/'/''}"
|
||||||
|
#done
|
||||||
|
|
||||||
|
function test() {
|
||||||
|
git for-each-ref --format='%(refname)' refs/heads/
|
||||||
|
}
|
||||||
33
main.sh
Executable file
33
main.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
#for branch in $(git for-each-ref --format='%(refname)' refs/heads/); do
|
||||||
|
# echo "${branch/'refs/heads/'/''}"
|
||||||
|
#done
|
||||||
|
|
||||||
|
clone_work_dir="/home/jonnybravo/workdir"
|
||||||
|
script_folder="$(pwd)"
|
||||||
|
echo $script_folder
|
||||||
|
#create_clone_Folder
|
||||||
|
if [ ! -d $clone_work_dir ]
|
||||||
|
then
|
||||||
|
mkdir -p $clone_work_dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
while IFS="," read -r git_url project_name
|
||||||
|
do
|
||||||
|
clone_folder="$clone_work_dir/$project_name"
|
||||||
|
if [ -d $clone_work_dir ]
|
||||||
|
then
|
||||||
|
echo "Verzechnis $clone_work_dir existiert bereits"
|
||||||
|
else
|
||||||
|
git clone $git_url $clone_folder
|
||||||
|
fi
|
||||||
|
cd $clone_folder
|
||||||
|
for branch in $(git for-each-ref --format='%(refname)' refs/heads/)
|
||||||
|
do
|
||||||
|
git_pro_branch="${branch/'refs/heads/'/''}"
|
||||||
|
echo "$project_name as $git_pro_branch"
|
||||||
|
done
|
||||||
|
cd $script_folder
|
||||||
|
|
||||||
|
done < <(tail -n +2 project.csv)
|
||||||
3
project.csv
Normal file
3
project.csv
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
git_url,project_name,
|
||||||
|
https://gitea.schlaubistechtalk.de/t4m/docker_gitlab.git,docker_gitlab,
|
||||||
|
https://gitea.schlaubistechtalk.de/t4m/win_ps_hidden_files.git,win_ps_hidden_files,
|
||||||
|
Reference in New Issue
Block a user