forked from FPirazz/Traffic-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request FPirazz#5 from FPirazz/develop
Develop
- Loading branch information
Showing
77 changed files
with
16,560 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
|
||
name: Build Gradle project | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
build-gradle-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project sources | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 19 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '19' | ||
distribution: 'temurin' # Or other distributions like 'adopt' | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
- name: Execute Gradle build | ||
run: ./gradlew build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,35 @@ | ||
# Compiled class file | ||
*.class | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
|
||
# Log file | ||
*.log | ||
./gradle/ | ||
|
||
# BlueJ files | ||
*.ctxt | ||
### IntelliJ IDEA ### | ||
.idea/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
replay_pid* | ||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Start from the official OpenJDK Docker image | ||
FROM openjdk:19-jdk-alpine | ||
|
||
# Set a directory for the app | ||
WORKDIR /app | ||
|
||
# Install bash | ||
RUN apk add --no-cache bash | ||
|
||
# Copy the rest of the project files into the docker image | ||
COPY . . | ||
|
||
RUN chmod +x ./gradlew | ||
|
||
# Remove Windows line endings from gradlew | ||
RUN sed -i -e 's/\r$//' gradlew | ||
|
||
# Build the project | ||
RUN ./gradlew build --parallel | ||
|
||
# Run the app using gradle | ||
CMD ["./gradlew", "run"] | ||
|
||
# Set bash as the entrypoint | ||
ENTRYPOINT ["bash"] | ||
|
||
# Commands for image generation and image execution | ||
# docker build -t java-image . | ||
# docker run -it --rm --name java-container java-image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Traffic-Management | ||
Project for both SPA and SPE | ||
|
||
|
||
Link to the [documentation (DOC).](https://marzolileo.github.io/Traffic-Management/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
plugins { | ||
id("org.danilopianini.git-sensitive-semantic-versioning") version "0.1.0" | ||
id("java") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_19 | ||
targetCompatibility = JavaVersion.VERSION_19 | ||
} | ||
|
||
tasks.wrapper { | ||
gradleVersion = "8.2" | ||
} | ||
|
||
allprojects { | ||
group = "org.SPE_SAP" | ||
version = "0.0.1-SNAPSHOT" | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
tasks.register("runAll") { | ||
group = "run" | ||
description = "Runs all the necessary component for the application" | ||
dependsOn(":userContext:runUserApplication") | ||
dependsOn(":tcm_frontend:npmRunVite") | ||
dependsOn(":intersectionAggregate:runAgents") | ||
} | ||
|
||
tasks.register("cleanAll") { | ||
group = "build" | ||
dependsOn(":userContext:clean") | ||
dependsOn(":tcm_frontend:npmClean") | ||
dependsOn(":intersectionAggregate:clean") | ||
} | ||
|
||
tasks.register("buildAll") { | ||
group = "build" | ||
dependsOn(":userContext:build") | ||
dependsOn(":tcm_frontend:npmBuildProject") | ||
dependsOn(":intersectionAggregate:build") | ||
} | ||
|
||
tasks.register("cleanAndBuildAll") { | ||
group = "build" | ||
description = "Builds and cleans all the subproject of the application" | ||
dependsOn("cleanAll") | ||
dependsOn("buildAll") | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Define the image names | ||
$images = "tcm_frontend:latest", "fpirazzoli/sap_spe_db:latest", "src/main/userContext:latest" | ||
|
||
# Loop through the images | ||
foreach ($image in $images) { | ||
# Pull the latest image | ||
docker pull $image | ||
|
||
# Get the image ID of the local image | ||
$local_image_id = docker images -q $image | ||
|
||
# Get the image ID of the remote image | ||
$remote_image_id = docker inspect --format='{{.Id}}' $image | ||
|
||
# Compare the image IDs | ||
if ($local_image_id -ne $remote_image_id) { | ||
# If the image IDs are different, remove the local image | ||
docker rmi $local_image_id | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Stop containers | ||
docker stop vue-app | ||
docker stop user_db | ||
docker stop spring-db-app | ||
|
||
# Remove containers | ||
docker rm vue-app | ||
docker rm user_db | ||
docker rm spring-db-app | ||
|
||
# Remove images | ||
docker rmi tcm_frontend:latest fpirazzoli/sap_spe_db:latest src/main/userContext:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
version: "3.7" | ||
|
||
services: | ||
|
||
vue-app: | ||
build: | ||
context: tcm_frontend | ||
dockerfile: Dockerfile | ||
container_name: vue-app | ||
restart: always | ||
ports: | ||
- "8080:80" | ||
|
||
user-db: | ||
image: "fpirazzoli/sap_spe_db:latest" | ||
container_name: user-db | ||
restart: always | ||
ports: | ||
- "8082:8082" | ||
- "9092:9092" | ||
|
||
spring-db-app: | ||
build: | ||
context: src/main/userContext | ||
dockerfile: Dockerfile | ||
container_name: spring-db-app | ||
restart: always | ||
ports: | ||
- "9085:9085" | ||
|
||
intersection-agents: | ||
build: | ||
context: intersectionAggregate | ||
dockerfile: Dockerfile | ||
container_name: intersection-agents | ||
restart: always | ||
ports: | ||
- "9080:9080" | ||
# nginx: | ||
# image: "nginx:latest" | ||
# container_name: nginx | ||
# restart: always | ||
# ports: | ||
# - "8085:80" | ||
|
||
#Per aggiungere un nuovo servizio | ||
#Seguire il template: | ||
|
||
#nome-servizio: | ||
#image: | ||
#ports: | ||
#container-name: | ||
# ecc.. ecc... (cambia a seconda delle necessità ma questi 3 sono quasi sempre obbligatori). | ||
|
||
#Eseguire il comando "docker compose up" e fa tutto lui. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.