aimerneige revisou este gist 5 days ago. Ir para a revisão
1 file changed, 55 insertions
auto_ninja.sh(arquivo criado)
| @@ -0,0 +1,55 @@ | |||
| 1 | + | repos=( | |
| 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 | + | ||
| 21 | + | current_dir=$(pwd) | |
| 22 | + | for 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 | + | ||
| 55 | + | done | |
Próximo
Anterior