Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/org.scala-lang-scala-libr…
Browse files Browse the repository at this point in the history
…ary-2.13.10
  • Loading branch information
jesperancinha committed May 15, 2023
2 parents 430adb0 + 77bbe8b commit ff5b300
Show file tree
Hide file tree
Showing 19 changed files with 254 additions and 103 deletions.
79 changes: 60 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
SHELL=/bin/bash
GITHUB_RUN_ID ?=123
SBT_VERSION ?= 1.8.3
NPM_MODULE_LOCATIONS := bl-bridge-server/bl-bridge-humidity-mqtt \
bl-bridge-server/bl-bridge-temperature-coap
PYTHON_MODULE_LOCATIONS := bl-demo-server \
bl-simulation-data
ALL_IMAGES := bridge-logistics-bl-train-01-rabbitmq-server \
bridge-logistics-bl-central-kafka-server \
bridge-logistics-bl-train-01-zookeeper-server \
bridge-logistics-bl-central-kafka-server \
bridge-logistics-bl-bridge-01-rabbitmq-server \
bridge-logistics-bl-bridge-01-temperature_coap_server \
bridge-logistics-bl-bridge-01-humidity_mqtt_server \
bridge-logistics-bl-vehicle-01-server \
bridge-logistics-bl-central-server \
bridge-logistics_postgres \
bridge-logistics-bl-central-server-apps

b: build
coverage-npm:
cd bl-bridge-server/bl-bridge-humidity-mqtt && yarn && jest --coverage
cd bl-bridge-server/bl-bridge-temperature-coap && yarn && jest --coverage
@for location in $(NPM_MODULE_LOCATIONS); do \
export CURRENT=$(shell pwd); \
echo "Running coverage for $$location..."; \
cd $$location; \
yarn; \
jest --coverage; \
cd $$CURRENT; \
done
coverage-python:
coverage run --source=bl-demo-server -m pytest && coverage json -o coverage-demo.json
coverage run --source=bl-simulation-data -m pytest && coverage json -o coverage-simulation.json
coverage-maven:
mvn clean install jacoco:prepare-agent package jacoco:report
coverage: coverage-npm coverage-python coverage-maven
build-npm:
cd bl-bridge-server/bl-bridge-temperature-coap && yarn && npm run build
cd bl-bridge-server/bl-bridge-humidity-mqtt && yarn && npm run build
@for location in $(NPM_MODULE_LOCATIONS); do \
export CURRENT=$(shell pwd); \
echo "Building $$location..."; \
cd $$location; \
yarn; \
npm run build; \
cd $$CURRENT; \
done
build-npm-cypress:
cd e2e && yarn
build-maven: create-demo-data
Expand All @@ -26,8 +54,13 @@ test-maven:
local: no-test
mkdir -p bin
test-node:
cd bl-bridge-server/bl-bridge-temperature-coap && npm run test
cd bl-bridge-server/bl-bridge-humidity-mqtt && npm run test
@for location in $(NPM_MODULE_LOCATIONS); do \
export CURRENT=$(shell pwd); \
echo "Testing $$location..."; \
cd $$location; \
npm run test; \
cd $$CURRENT; \
done
test: test-maven test-node
no-test:
mvn clean install -DskipTests
Expand Down Expand Up @@ -96,18 +129,11 @@ docker-delete: stop
docker ps -a --format '{{.ID}}' -q --filter="name=bl-" | xargs -I {} docker stop {}
docker ps -a --format '{{.ID}}' -q --filter="name=bl-" | xargs -I {} docker rm {}
docker-cleanup: stop-containers docker-delete
docker images -q | xargs docker rmi
docker rmi bridge-logistics-bl-train-01-rabbitmq-server
docker rmi bridge-logistics-bl-central-kafka-server
docker rmi bridge-logistics-bl-train-01-zookeeper-server
docker rmi bridge-logistics-bl-central-kafka-server
docker rmi bridge-logistics-bl-bridge-01-rabbitmq-server
docker rmi bridge-logistics-bl-bridge-01-temperature_coap_server
docker rmi bridge-logistics-bl-bridge-01-humidity_mqtt_server
docker rmi bridge-logistics-bl-vehicle-01-server
docker rmi bridge-logistics-bl-central-server
docker rmi bridge-logistics_postgres
docker rmi bridge-logistics-bl-central-server-apps
docker images -q | xargs -I {} docker rmi {}
@for image in $(ALL_IMAGES); do \
echo "Stopping image $$image..."; \
docker rmi $$image; \
done
docker-action:
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml up -d
docker-delete-apps: stop
Expand Down Expand Up @@ -172,7 +198,7 @@ cypress-electron: log-all
cypress-chrome: log-all
cd e2e && make cypress-chrome
cypress-firefox: log-all
cd e2e && make cypress-firefox
cd e2e && make cypress-firefox
cypress-firefox-full: log-all
cd e2e && make cypress-firefox-full
cypress-edge: log-all
Expand Down Expand Up @@ -215,3 +241,18 @@ install-coverage-python:
sudo apt install python3-pip -y
sudo pip3 install coverage
sudo pip3 install pytest
upgrade-sbt:
sudo apt upgrade
sudo apt update
export SDKMAN_DIR="$(HOME)/.sdkman"; \
[[ -s "$(HOME)/.sdkman/bin/sdkman-init.sh" ]]; \
source "$(HOME)/.sdkman/bin/sdkman-init.sh"; \
sdk update; \
sbtVersion=$(shell sbt --version | tr '\n' ' ' | cut -f6 -d' '); \
if [[ -z "$$sbtVersion" ]]; then \
sdk install sbt $(SBT_VERSION); \
sdk use gradle $(SBT_VERSION); \
else \
(yes "" 2>/dev/null || true) | sdk install sbt; \
fi; \
export SBT_VERSION=$(shell sbt --version | tr '\n' ' ' | cut -f6 -d' ');
5 changes: 5 additions & 0 deletions bl-central-server/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
b: build
build:
mvn clean install
no-test:
mvn clean install -DskipTests
24 changes: 24 additions & 0 deletions bl-central-server/bl-central-readings/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MODULE_LOCATIONS := bl-meters-readings-service bl-passengers-readings-service

b: build
build:
mvn clean install
no-test:
mvn clean install -DskipTests
start-readings: no-test
@for location in $(MODULE_LOCATIONS); do \
export CURRENT=$(shell pwd); \
echo "Starting services $$location..."; \
cd $$location; \
make start-readings \
cd $$CURRENT; \
done
stop-readings:
@for location in $(MODULE_LOCATIONS); do \
export CURRENT=$(shell pwd); \
echo "Stopping services $$location..."; \
cd $$location; \
make stop-readings \
cd $$CURRENT; \
done

Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ no-test:
mvn clean install -DskipTests
start-readings:
java --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED -jar target/bl-meters-readings-service-jar-with-dependencies.jar
stop-readings:
processAString=$(ps -fx | grep -e "bl-meters-readings-service-jar-with-dependencies.jar" | grep -v "grep"); \
processNumber="$(echo "${processAString}" | cut -d' ' -f2)"; \
echo "${processNumber}"; \
kill -9 "${processNumber}" &

Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@
<groupId>org.scala-sbt</groupId>
<artifactId>compiler-bridge_${scala.sdk.version}</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ no-test:
mvn clean install -DskipTests
start-readings:
java --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED -jar target/bl-passengers-readings-service-jar-with-dependencies.jar
stop-readings:
processAString=$(ps -fx | grep -e "bl-passengers-readings-service-jar-with-dependencies.jar" | grep -v "grep"); \
processNumber="$(echo "${processAString}" | cut -d' ' -f2)"; \
echo "${processNumber}"; \
kill -9 "${processNumber}" &
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@
<groupId>org.scala-sbt</groupId>
<artifactId>compiler-bridge_${scala.sdk.version}</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -102,7 +114,7 @@
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.jesperancinha.logistics.readings.PassengersReadingsLauncher</mainClass>
<mainClass>org.jesperancinha.logistics.passengers.readings.PassengersReadingsLauncher</mainClass>
</manifest>
</archive>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package org.jesperancinha.logistics.readings
package org.jesperancinha.logistics.passengers.readings

import com.datastax.spark.connector._
import com.datastax.spark.connector.cql.CassandraConnector
import com.typesafe.config.ConfigFactory
import org.apache.kafka.clients.consumer.ConsumerRecord
import org.apache.kafka.common.serialization.StringDeserializer
import org.apache.spark.SparkConf
import org.apache.spark.streaming.kafka010.{ConsumerStrategies, KafkaUtils, LocationStrategies}
import org.apache.spark.streaming.{Durations, StreamingContext}
import org.apache.spark.{SparkConf, SparkContext}
import org.jesperancinha.logistics.passengers.readings.Passenger
import play.api.libs.json.Json

import java.util.UUID
Expand Down
96 changes: 91 additions & 5 deletions bl-central-server/bl-central-readings/pom.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,100 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jesperancinha.logistics</groupId>
<artifactId>bl-central-server</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
<groupId>org.jesperancinha.logistics</groupId>
<artifactId>bl-central-readings</artifactId>
<version>2.0.0-SNAPSHOT</version>
<modules>
<module>bl-meters-readings-service</module>
<module>bl-passengers-readings-service</module>
</modules>

<properties>
<scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>
<scala.sdk.version>2.12</scala.sdk.version>
<scala-library.version>${scala.sdk.version}.16</scala-library.version>
<spark.version>3.4.0</spark.version>
<jnr-posix.version>3.1.16</jnr-posix.version>
<config.version>1.4.2</config.version>
<compiler-bridge.version>1.8.1</compiler-bridge.version>
<spark-cassandra-connector.version>3.3.0</spark-cassandra-connector.version>
<play-json.version>2.9.4</play-json.version>
<maven-assembly-plugin.version>3.5.0</maven-assembly-plugin.version>
<omni-coveragereporter-maven-plugin.version>0.4.3</omni-coveragereporter-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<jackson.version>2.14.3</jackson.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-json_${scala.sdk.version}</artifactId>
<version>${play-json.version}</version>
</dependency>
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_${scala.sdk.version}</artifactId>
<version>${spark-cassandra-connector.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala-library.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scala.sdk.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.sdk.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_${scala.sdk.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-kafka-0-10_${scala.sdk.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.scala-sbt</groupId>
<artifactId>compiler-bridge_${scala.sdk.version}</artifactId>
<version>${compiler-bridge.version}</version>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>${jnr-posix.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>${config.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
5 changes: 5 additions & 0 deletions bl-central-server/bl-domain-repository/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
b: build
build:
mvn clean install
no-test:
mvn clean install -DskipTests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.jesperancinha.logistics.jpa.dao

import org.hibernate.Hibernate
import java.math.BigDecimal
import javax.persistence.*
import jakarta.persistence.*

@Entity
@Table(name = "bridge")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jesperancinha.logistics.jpa

import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.data.jpa.repository.config.EnableJpaRepositories

Expand Down
4 changes: 4 additions & 0 deletions bl-central-server/bl-merchandise-data-collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions bl-central-server/bl-sensor-data-collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
Expand Down
Loading

0 comments on commit ff5b300

Please sign in to comment.