"pynemo/git@git.noc.ac.uk:thopri/PyNEMO.git" did not exist on "d5bdf5cec1d5340816bcbe4b77a12565e7a51854"
Commit 313f5674 authored by James Kirk's avatar James Kirk
Browse files

refactor: closing files that have been opened

feat: dockerised and composed everything up, introduced run-compose and gitlab-ci
include:
- project: oceanids/c2/infrastructure/ci-scripts
ref: master
file: python-microservice/all.yml
variables:
DOCKER_IMAGE_NAME: backbone-message-format
TEST_DOCKER_COMPOSE: 1
\ No newline at end of file
FROM python:3.9.16-alpine
WORKDIR /app
COPY requirements-dev.txt requirements-dev.txt
RUN pip install -r requirements-dev.txt
\ No newline at end of file
FROM python:3.9.16-alpine
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
\ No newline at end of file
version: '3.8'
services:
soar_flasgger_test:
build:
context: ..
dockerfile: docker/Dev.Dockerfile
restart: unless-stopped
ports:
- "5000:5000"
container_name: soar_flasgger_test
environment:
- PYTHONDONTWRITEBYTECODE=1
volumes:
- ../:/app
command: "python3 -m unittest tests/test_schemas.py"
\ No newline at end of file
version: '3.8'
services:
soar_flasgger:
build:
context: ..
dockerfile: docker/Dockerfile
restart: unless-stopped
ports:
- "5000:5000"
container_name: soar_flasgger
environment:
- FLASK_HOST=0.0.0.0
volumes:
- ../:/app
command: "python generate_schema_config.py"
\ No newline at end of file
......@@ -8,6 +8,8 @@ from formats.acknowledgement import acknowledgement_schema
from flasgger import Swagger
from flask import Flask
import os
app = Flask(__name__)
......@@ -74,6 +76,9 @@ swagger_config = {
swag = Swagger(app, config=swagger_config, merge=True)
flask_host = os.getenv(
"FLASK_HOST", "localhost"
) # Sets to whatever MQ_HOST is, or defaults to localhost
if __name__ == "__main__":
app.run(debug=True)
app.run(debug=False, host=flask_host)
#! /usr/bin/env bash
usage() {
echo "usage: ./run-compose.sh [<rebuild>]"
echo " rebuild - will force docker-compose to rebuild the images before spinning them up."
echo " tests - run the test suite rather than the application."
}
if [[ -z "${DATA_DIR}" ]]; then
DATA_DIR=$(pwd)
fi
while [ -n "$1" ]; do
case $1 in
rebuild)
EXTRA_ARGS="--build"
;;
tests)
docker-compose -f docker/docker-compose-test.yaml up --build
exit 0
;;
*)
usage
exit 0
;;
esac
shift
done
docker-compose -f docker/docker-compose.yaml up $EXTRA_ARGS
\ No newline at end of file
......@@ -66,6 +66,8 @@ class TestSchema(unittest.TestCase):
)
)
f.close()
def test_sample_gui_messages(self):
"""
Test schema - GUI Messages
......@@ -92,6 +94,8 @@ class TestSchema(unittest.TestCase):
)
)
f.close()
def test_sample_ecosub_messages(self):
"""
Test schema - Ecosub Messages
......@@ -146,6 +150,8 @@ class TestSchema(unittest.TestCase):
format_checker=FormatChecker(),
)
)
f.close()
def test_sample_autonomy_engine_messages(self):
"""
......@@ -237,6 +243,8 @@ class TestSchema(unittest.TestCase):
)
)
f.close()
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment