Skip to content

Commit 18da9d5

Browse files
committed
Aggiunto build/deploy per Mac con architettura Apple Silicon
1 parent 2249d2d commit 18da9d5

File tree

3 files changed

+91
-4
lines changed

3 files changed

+91
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ These services can be invoked directly from the host machine when needed.
5050

5151
## System Deployment and Installation
5252
TestingRobotChallenge includes a suite of scripts to simplify the build and deployment process:
53-
- `build.bat` / `build.sh`: Windows/Linux scripts to build and create Docker images for all microservices and components;
54-
- `deploy.bat` / `deploy.sh`: Windows/Linux scripts to deploy all containers, create necessary Docker volumes and networks, and start services. Local images will be used if available; otherwise, images from DockerHub will be pulled;
53+
- `build.bat` / `build.sh` / `buildMacOs.sh`: Windows, Linux and macOS scripts to build and create Docker images for all microservices and components;
54+
- `deploy.bat` / `deploy.sh`: Windows and Linux/macOS scripts to deploy all containers, create necessary Docker volumes and networks, and start services. Local images will be used if available; otherwise, images from DockerHub will be pulled;
5555
- `selective_build_and_deploy.bat` / `selective_build_and_deploy.sh`: Windows/Linux scripts that allow selective build and deployment of specific microservices, mainly used during development;
5656
- `uninstaller.bat` / `uninstaller.sh`: Windows/Linux scripts that purge all Docker containers, images, networks, and volumes on the host. Use with caution.
5757

58+
Please note that the macOS scripts have only been tested on Macs with Apple Silicon architecture.
59+
5860
## How to Configure the Game
59-
Administrators are in charge to preliminary configure the Web App by uploading the Java Classes to be tested and the Test Cases automatically generated by the Robots.
61+
Administrators are in charge to preliminarily configure the Web App by uploading the Java Classes to be tested and the Test Cases automatically generated by the Robots.
6062
The ClassUT directory of the repository contains some examples of Java Classes and the test cases automatically generated by several Generators, namely EVOSUITE, Randoop, and different LLMs (ChatGPT, Gemini, and Llama).
6163

62-
## How to Play
6364

6465

6566

T23-G1/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ volumes:
66
services:
77
db:
88
image: mysql:latest
9+
platform: linux/amd64
910
container_name: t23-mysql_db
1011
environment:
1112
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}

buildMacOS.sh

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
3+
set -e # Ferma lo script se un comando fallisce
4+
5+
echo "Build process started"
6+
7+
ROOT_DIR=$(pwd) # Salva la directory di partenza
8+
9+
# Build commons
10+
echo "Building T-shared"
11+
export JAVA_HOME=${JAVA_HOME:-"/usr/lib/jvm/java-21-openjdk-amd64"}
12+
cd "$ROOT_DIR/T-shared"
13+
mvn install || { echo "Error in T-shared build during mvn install. Check JAVA_HOME." ; exit 1; }
14+
cd "$ROOT_DIR"
15+
16+
# Build T1-G11
17+
echo "Building T1-G11"
18+
cd "$ROOT_DIR/T1-G11/applicazione/manvsclass"
19+
mvn clean package -Dspring.profiles.active=prod || { echo "Error in T1-G11 build during mvn clean package" ; exit 1; }
20+
docker build -t mick0974/a13:t1-g11 .
21+
cd "$ROOT_DIR"
22+
23+
# Build T23-G1
24+
echo "Building T23-G1"
25+
cd "$ROOT_DIR/T23-G1"
26+
mvn clean package || { echo "Error in T23-G1 build during mvn clean package" ; exit 1; }
27+
docker buildx build --platform linux/amd64 -t mick0974/a13:t23-g1 .
28+
cd "$ROOT_DIR"
29+
30+
# Build T4-G18
31+
echo "Building T4"
32+
cd "$ROOT_DIR/T4/gamerepo"
33+
mvn clean package -DskipTests=true -Dspring.profiles.active=prod || { echo "Error in T4 build during mvn clean package" ; exit 1; }
34+
docker build -t mick0974/a13:t4-g18 .
35+
cd "$ROOT_DIR"
36+
37+
# Build T5-G2
38+
echo "Building T5-G2"
39+
cd "$ROOT_DIR/T5-G2/t5"
40+
mvn clean package -DskipTests=true -Dspring.profiles.active=prod || { echo "Error in T5-G2 build during mvn clean package" ; exit 1; }
41+
docker build -t mick0974/a13:t5-g2 .
42+
cd "$ROOT_DIR"
43+
44+
# Build T7-G31
45+
echo "Building T7-G31"
46+
cd "$ROOT_DIR/T7-G31/RemoteCCC"
47+
mvn clean package -DskipTests=true || { echo "Error in T7-G31 build during mvn clean package" ; exit 1; }
48+
docker build -t mick0974/a13:t7-g31 .
49+
cd "$ROOT_DIR"
50+
51+
# Build T8-G21
52+
echo "Building T8-G21"
53+
cd "$ROOT_DIR/T8-G21/T8"
54+
mvn clean package || { echo "Error in T8-G21 build during mvn clean package" ; exit 1; }
55+
docker buildx build --platform linux/amd64 -t mick0974/a13:t8-g21 .
56+
cd "$ROOT_DIR"
57+
58+
# Build ui_gateway
59+
echo "Building ui_gateway"
60+
cd "$ROOT_DIR/ui_gateway"
61+
docker build -t mick0974/a13:ui-gateway .
62+
cd "$ROOT_DIR"
63+
64+
# Build api_gateway
65+
echo "Building api_gateway"
66+
cd "$ROOT_DIR/apiGateway"
67+
mvn clean package || { echo "Error in api_gateway build during mvn clean package" ; exit 1; }
68+
docker build -t mick0974/a13:api-gateway .
69+
cd "$ROOT_DIR"
70+
71+
# Build T0
72+
echo "Building T0"
73+
cd "$ROOT_DIR/T0/RandoopGenerator"
74+
mvn clean package || { echo "Error in RandoopGenerator mvn package"; exit 1; }
75+
cd ..
76+
docker build -t mick0974/a13:t0 .
77+
cd "$ROOT_DIR"
78+
79+
# Build T0
80+
echo "Building db-backup"
81+
cd "$ROOT_DIR/db-backup"
82+
docker build -t mick0974/a13:db-backup .
83+
cd "$ROOT_DIR"
84+
85+
echo "Build process completed"

0 commit comments

Comments
 (0)