Commit 333c729f authored by Manuel's avatar Manuel

switch microservices to use of general resource folder

parent 718c4778
...@@ -16,7 +16,7 @@ LOGGER = logging.getLogger(__name__) ...@@ -16,7 +16,7 @@ LOGGER = logging.getLogger(__name__)
################################# #################################
import connexion import connexion
from security import swagger_util from security import swagger_util
from env_info import is_running_locally from env_info import is_running_locally, get_resources_path
from messaging.ReconnectingMessageManager import ReconnectingMessageManager from messaging.ReconnectingMessageManager import ReconnectingMessageManager
from messaging.MessageHandler import MessageHandler from messaging.MessageHandler import MessageHandler
...@@ -33,18 +33,13 @@ def api_root(): ...@@ -33,18 +33,13 @@ def api_root():
return 'Endpoint of semantic-linking-microservice!' return 'Endpoint of semantic-linking-microservice!'
# SSL configuration # SSL configuration
try: certificate_path = get_resources_path()
certificate_path = os.environ['ARTICONF_CERTIFICATE_PATH']
except KeyError:
certificate_path = '/srv/articonf/'
context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files
if is_running_locally(): if is_running_locally():
# Local Mode print("Running locally...")
print("Running with local settings...")
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger_local.yml")), app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger_local.yml")),
resolver = connexion.RestyResolver("cms_rest_api")) resolver = connexion.RestyResolver("cms_rest_api"))
context = 'adhoc'
else: else:
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger.yml")), app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger.yml")),
resolver = connexion.RestyResolver("cms_rest_api")) resolver = connexion.RestyResolver("cms_rest_api"))
......
...@@ -32,6 +32,14 @@ spec: ...@@ -32,6 +32,14 @@ spec:
image: alexx882/semantic-linking-microservice image: alexx882/semantic-linking-microservice
ports: ports:
- containerPort: 5000 - containerPort: 5000
volumeMounts:
- mountPath: /srv/articonf
name: articonf
volumes:
- name: articonf
hostPath:
path: /srv/articonf
type: Directory
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
......
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