Last active 4 days ago

auto_ninja.sh Raw
1repos=(
2 cstools
3 webtools
4 docgenerator
5 dbtools
6 commandframework
7 static
8 ipmicontroller
9 gitrunner
10 aiurobserver
11 cpprunner
12 arraydb
13 inmemorykvdb
14 gptclient
15 gitmirrorserver
16 internalimages
17 warp
18 infrastructures
19)
20
21current_dir=$(pwd)
22for repo in "${repos[@]}"; do
23
24 # make sure the directory exists
25 if [ ! -d "$repo" ]; then
26 echo "Cloning $repo..."
27 git clone "ssh://git@gitlab.aiursoft.cn:2202/aiursoft/$repo.git" || {
28 echo "Error: failed to clone $repo" >&2
29 exit 1
30 }
31 else
32 echo "Skipping existing $repo"
33 fi
34
35 cd "$repo" || exit 1
36
37 # make sure the branch is master
38 git checkout master || {
39 echo "Error: failed to checkout master branch for $repo" >&2
40 exit 1
41 }
42
43 # pull the latest changes
44 git pull origin master || {
45 echo "Error: failed to pull latest changes for $repo" >&2
46 exit 1
47 }
48
49 # execute the ninja command
50 ninja all --path .
51
52 # return to the original directory
53 cd $current_dir || exit 1
54
55done
56