Skip to content

Commit

Permalink
Update build scripts to support microservices build on Linux/MacOsX/W…
Browse files Browse the repository at this point in the history
…indows (futurewei-cloud#146)

* Update build.ps1 to support microservices

* Update build.sh to support microservices
  • Loading branch information
Liguang Xie authored Apr 3, 2020
1 parent 0e92f99 commit 0ba6274
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
29 changes: 29 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,33 @@ mvn clean
mvn compile
mvn install

Write-Host "Clean build common library project"
cd lib
mvn clean
mvn compile
mvn install
cd ..

Write-Host "Clean build web project"
cd web
mvn clean
mvn compile
mvn install
cd ..

Write-Host "Build service one by one under services directory"
cd services
$service_subdirectories = Get-ChildItem -Directory -Force -ErrorAction SilentlyContinue
foreach($subdirectory in $service_subdirectories)
{
Write-Host "Build service - $($subdirectory.name)"
cd $subdirectory.name
mvn clean
mvn compile
mvn install
cd ..
Write-Host "Build service - $($subdirectory.name) completed" -ForegroundColor green
}

cd ..
Write-Host "Build completed" -ForegroundColor green
62 changes: 60 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,75 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
sudo apt-get install maven
sudo apt-get install openjdk-8-jdk

# Clean build controller project
echo "Clean build controller project"
mvn clean
mvn compile
mvn install

echo "Clean build common library project"
cd lib
mvn clean
mvn compile
mvn install
cd ..

echo "Clean build web project"
cd web
mvn clean
mvn compile
mvn install
cd ..

echo "Build service one by one under services directory"
cd services
for d in ./*/;
do
echo "Build service - $d"
cd $d
mvn clean
mvn compile
mvn install
cd ..
echo "Build service - $d completed"
done

elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Install prerequisites in Mac OSX"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install maven

# Clean build controller project
echo "Clean build controller project"
mvn clean
mvn compile
mvn install -DskipTests

echo "Clean build common library project"
cd lib
mvn clean
mvn compile
mvn install -DskipTests
cd ..

echo "Clean build web project"
cd web
mvn clean
mvn compile
mvn install -DskipTests
cd ..

echo "Build service one by one under services directory"
cd services
for d in ./*/;
do
echo "Build service - $d"
cd $d
mvn clean
mvn compile
mvn install -DskipTests
cd ..
echo "Build service - $d completed"
done

elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
echo "Install prerequisites in Linux environment of Windows"
Expand All @@ -29,3 +85,5 @@ elif [[ "$OSTYPE" == "msys" ]]; then
else
echo "Unknown supported OS"
fi

echo "Build completed"

0 comments on commit 0ba6274

Please sign in to comment.