[AB-xxx] refactoring rest-api to not be a maven project and restructuring python tool file structure

This commit is contained in:
Sheldan
2023-12-20 21:04:35 +01:00
parent 474e632fed
commit e9d14ac417
31 changed files with 46 additions and 68 deletions

View File

@@ -50,7 +50,6 @@ jobs:
path: ./deployment/installer/.env
- name: Push container
run: docker-compose build && docker-compose push
working-directory: ./deployment/installer/
env:
REGISTRY_PREFIX: ${{ steps.dotenv.outputs.registry_prefix }}
VERSION: ${{ steps.dotenv.outputs.version }}

View File

@@ -19,7 +19,6 @@
<module>scheduling</module>
<module>documentation</module>
<module>bundle</module>
<module>rest-api</module>
</modules>
<distributionManagement>

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>dev.sheldan.abstracto</groupId>
<artifactId>abstracto-application</artifactId>
<version>1.5.15-SNAPSHOT</version>
</parent>
<groupId>dev.sheldan.sissi.api</groupId>
<artifactId>rest-api</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>rest-api-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,19 +0,0 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>zip</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<outputDirectory>resources</outputDirectory>
<directory>${project.basedir}/src/main/resources</directory>
</fileSet>
<fileSet>
<outputDirectory>.</outputDirectory>
<directory>${project.basedir}/src/main/python</directory>
</fileSet>
</fileSets>
</assembly>

View File

@@ -1,9 +0,0 @@
version: "3.7"
services:
config_deployment:
build: config-deployment
image: ${REGISTRY_PREFIX}abstracto-db-deployment:${VERSION:-latest}
template_deployment:
build: template-deployment
image: ${REGISTRY_PREFIX}abstracto-template-deployment:${VERSION:-latest}

14
docker-compose.yaml Normal file
View File

@@ -0,0 +1,14 @@
version: "3.7"
services:
config_deployment:
build: python/deployment/installer/config-deployment
image: ${REGISTRY_PREFIX}abstracto-db-deployment:${VERSION:-latest}
template_deployment:
build: python/deployment/installer/template-deployment
image: ${REGISTRY_PREFIX}abstracto-template-deployment:${VERSION:-latest}
rest_api:
build:
context: python/components/rest-api
dockerfile: docker/Dockerfile
image: ${REGISTRY_PREFIX}abstracto-rest-api:${VERSION:-latest}

View File

@@ -0,0 +1,10 @@
FROM python:3.10.13-alpine3.18
RUN apk --no-cache add msttcorefonts-installer fontconfig && \
update-ms-fonts && \
fc-cache -f
ADD wrapper /
ADD python/requirements.txt requirements.txt
RUN pip install -r requirements.txt
ADD resources /python/resources
ADD python /python
CMD ["/run.sh"]

View File

@@ -0,0 +1,17 @@
blinker==1.7.0
certifi==2023.7.22
charset-normalizer==3.3.2
click==8.1.7
Flask==3.0.0
idna==3.4
importlib-metadata==6.8.0
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
Pillow==10.1.0
requests==2.31.0
urllib3==2.0.7
waitress==2.1.2
Werkzeug==3.0.1
zipp==3.17.0
pytz==2023.3.post1

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,5 @@
#!/bin/sh
echo "Starting python server..."
cd python
python3 -u main.py