#!/bin/bash

baseDir="/home/somuns/ci4s"


#判断$1是否为all，如果是，则编译所有模块，否则只编译management-platform模块
if [ "$1" == "all" ]; then
   buildDir=$baseDir
elif [ "$1" == "manage" ]; then
   buildDir="$baseDir/ruoyi-modules/management-platform"
elif [ "$1" == "auth" ]; then
   buildDir="$baseDir/ruoyi-auth"
elif [ "$1" == "gateway" ]; then
   buildDir="$baseDir/ruoyi-gateway"
elif [ "$1" == "system" ]; then
   buildDir="$baseDir/ruoyi-modules/ruoyi-system"
fi

echo "Building $buildDir"
cd  $buildDir  && mvn clean install

if [ $? -ne 0 ]; then
    echo "Failed to build ruoyi-modules"
    exit 1
fi








