-
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.
- Loading branch information
Showing
94 changed files
with
1,372 additions
and
2,026 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Docker Build Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile |
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
name: Docker Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install xmlstarlet | ||
run: sudo apt-get install -y xmlstarlet | ||
|
||
- name: Extract version from pom.xml | ||
id: extract_version | ||
run: | | ||
VERSION=$(xmlstarlet sel -t -v "/_:project/_:version" pom.xml) | ||
echo "VERSION=$VERSION" | ||
echo "::set-output name=version::$VERSION" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and Push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: lrprojects/tempserver:${{ steps.extract_version.outputs.version }} |
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,14 +1,14 @@ | ||
#Maven Build | ||
FROM maven:3.8.3-openjdk-17-slim AS builder | ||
COPY pom.xml /app/ | ||
COPY src /app/src | ||
ENV DB_USER=postgres | ||
ENV DB_PASSWORD=postgres | ||
ENV DATASOURCE_URL=jdbc:postgresql://127.0.0.1:5432/postgres | ||
RUN --mount=type=cache,target=/root/.m2 mvn -f /app/pom.xml clean package -DskipTests | ||
COPY pom.xml /tmp/pom.xml | ||
WORKDIR /tmp | ||
RUN mvn -B -f /tmp/pom.xml dependency:resolve | ||
COPY src /tmp/src | ||
RUN mvn clean install | ||
|
||
#Run | ||
FROM openjdk:17-jdk-slim | ||
COPY --from=builder /app/target/SpringServer-1.jar app.jar | ||
WORKDIR /app | ||
COPY --from=build /tmp/target/*jar /app/app.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java", "-jar", "app.jar"] |
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,43 @@ | ||
services: | ||
temp-server: | ||
container_name: temp-server | ||
build: . | ||
restart: unless-stopped | ||
ports: | ||
- 8081:8081 | ||
env_file: | ||
- ./.env | ||
environment: | ||
DB_HOST: db | ||
EMAIL: lr.dev.projects@gmail.com | ||
|
||
# ---- Edit to change default: ---- | ||
# PORT: 8081 | ||
|
||
# ---- From .env file: ------- | ||
# POSTGRES_PASSWORD | ||
# POSTGRES_USER | ||
# POSTGRES_DB | ||
# EMAIL_PASSWORD | ||
# SECRET | ||
depends_on: | ||
- db | ||
networks: | ||
- net | ||
db: | ||
image: postgres:16 | ||
restart: unless-stopped | ||
container_name: stick-it-db | ||
ports: | ||
- 5433:5432 | ||
volumes: | ||
- ./postgres-data:/var/lib/postgresql/data | ||
- ./backup:/backup | ||
env_file: | ||
- ./.env | ||
networks: | ||
- net | ||
|
||
networks: | ||
net: | ||
name: "stick-it-network" |
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,52 @@ | ||
get: | ||
summary: Get all sensor categories | ||
operationId: getAllSensorCategories | ||
tags: | ||
- Sensor Categories | ||
responses: | ||
'200': | ||
description: A list of sensor categories | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../schemas/categoryDto.yaml' | ||
put: | ||
summary: Update a sensor category | ||
operationId: updateSensorCategory | ||
tags: | ||
- Sensor Categories | ||
requestBody: | ||
description: The sensor category to update | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/categoryDto.yaml' | ||
responses: | ||
'200': | ||
description: The updated sensor category | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/categoryDto.yaml' | ||
post: | ||
summary: Create a new sensor category | ||
operationId: createSensorCategory | ||
tags: | ||
- Sensor Categories | ||
requestBody: | ||
description: The sensor category to create | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/categoryDto.yaml' | ||
responses: | ||
'200': | ||
description: The created sensor category | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/categoryDto.yaml' |
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,36 @@ | ||
get: | ||
summary: Get a sensor category by ID | ||
operationId: getSensorCategoryById | ||
tags: | ||
- Sensor Categories | ||
parameters: | ||
- name: categoryId | ||
in: path | ||
required: true | ||
description: The ID of the sensor category to retrieve | ||
schema: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'200': | ||
description: The sensor category with the specified ID | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/categoryDto.yaml' | ||
delete: | ||
summary: Delete a sensor category by ID | ||
operationId: deleteSensorCategory | ||
tags: | ||
- Sensor Categories | ||
parameters: | ||
- name: categoryId | ||
in: path | ||
required: true | ||
description: The ID of the sensor category to delete | ||
schema: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'204': | ||
description: No content, category deleted successfully |
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,33 @@ | ||
get: | ||
summary: Get all sensor types | ||
operationId: getSensorTypes | ||
tags: | ||
- Sensor Types | ||
responses: | ||
'200': | ||
description: A list of sensor types | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../schemas/typeDto.yaml' | ||
post: | ||
summary: Create a new sensor type | ||
operationId: postSensorType | ||
tags: | ||
- Sensor Types | ||
requestBody: | ||
description: The sensor type to create | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/typeDto.yaml' | ||
responses: | ||
'200': | ||
description: The created sensor type | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/typeDto.yaml' |
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,43 @@ | ||
get: | ||
summary: Get a sensor type by ID | ||
operationId: getSensorTypeById | ||
tags: | ||
- Sensor Types | ||
parameters: | ||
- $ref: '../parameters/id.yaml' | ||
responses: | ||
'200': | ||
description: The sensor type with the specified ID | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/typeDto.yaml' | ||
put: | ||
summary: Update a sensor type | ||
operationId: putSensorType | ||
tags: | ||
- Sensor Types | ||
requestBody: | ||
description: The sensor type to update | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/typeDto.yaml' | ||
responses: | ||
'200': | ||
description: The updated sensor type | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/typeDto.yaml' | ||
delete: | ||
summary: Delete a sensor type by ID | ||
operationId: deleteSensorType | ||
tags: | ||
- Sensor Types | ||
parameters: | ||
- $ref: '../parameters/sensorTypeId.yaml' | ||
responses: | ||
'204': | ||
description: No content, sensor type deleted successfully |
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,34 @@ | ||
get: | ||
summary: Get all sensors | ||
operationId: getSensors | ||
tags: | ||
- Sensors | ||
responses: | ||
'200': | ||
description: A list of sensors | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: '../schemas/sensorDto.yaml' | ||
|
||
post: | ||
summary: Create a new sensor | ||
operationId: postSensor | ||
tags: | ||
- Sensors | ||
requestBody: | ||
description: The sensor to create | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/sensorDto.yaml' | ||
responses: | ||
'200': | ||
description: The created sensor | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../schemas/sensorDto.yaml' |
Oops, something went wrong.