Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
webservices
cern-search
cern-search-rest-api
Commits
fac7fd6a
Commit
fac7fd6a
authored
Oct 31, 2019
by
Carina Antunes
Browse files
global: env configurations
parent
68725f58
Changes
8
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
fac7fd6a
...
...
@@ -7,6 +7,7 @@
*pyc
cern_search_rest_api.egg-info/
.eggs
# OpenShift Secrets
...
...
@@ -36,3 +37,6 @@ builds/
# Test files
.api_token
# Others
.DS_Store
Makefile
View file @
fac7fd6a
...
...
@@ -61,7 +61,7 @@ generate-certificates:
test
:
docker-compose
-f
$(DOCKER_FILE)
exec
-T
$(SERVICE_NAME)
/bin/bash
-c
\
"API_TOKEN=
$$
(
<
$(API_TOKEN)
) pytest tests -vv;"
"API_TOKEN=
$$
(
cat
$(API_TOKEN)
) pytest tests -vv;"
.PHONY
:
test
lint
:
...
...
@@ -91,7 +91,7 @@ lint:
PIPENV_DOTENV
:=
.pipenv.env
PYTHON_VERSION_FILE
:=
.python-version
PYTHON_VERSION
:=
$(
shell
cat
$(PYTHON_VERSION_FILE)
| xargs
)
PYTHON_VERSION
:=
$
(
cat
$(PYTHON_VERSION_FILE)
| xargs
)
PIPENV_DOCKER_FILE
:=
docker-compose.yml
local-env-logs
:
...
...
cern_search_rest_api/config.py
View file @
fac7fd6a
...
...
@@ -193,6 +193,3 @@ SECURITY_CONFIRMABLE = False
SECURITY_REGISTERABLE
=
False
# Avoid user registration outside of CERN SSO
SECURITY_RECOVERABLE
=
False
# Avoid user password recovery
SESSION_COOKIE_SECURE
=
True
# LOGGING_LEVEL
LOGGING_CONSOLE_LEVEL
=
os
.
getenv
(
'INVENIO_LOGGING_CONSOLE_LEVEL'
,
'DEBUG'
)
cern_search_rest_api/modules/cernsearch/ext.py
View file @
fac7fd6a
...
...
@@ -7,11 +7,9 @@
# CERN Search is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
from
cern_search_rest_api.config
import
LOGGING_CONSOLE_LEVEL
from
cern_search_rest_api.modules.cernsearch.indexer
import
csas_indexer_receiver
from
cern_search_rest_api.modules.cernsearch.views
import
build_blueprint
from
invenio_indexer.signals
import
before_record_index
from
invenio_logging.console
import
InvenioLoggingConsole
class
CERNSearch
(
object
):
...
...
@@ -30,9 +28,6 @@ class CERNSearch(object):
before_record_index
.
connect
(
csas_indexer_receiver
,
sender
=
app
)
app
.
extensions
[
"cern-search"
]
=
self
#InvenioLoggingConsole(app)
app
.
logger
.
setLevel
(
LOGGING_CONSOLE_LEVEL
)
app
.
logger
.
debug
(
'Starting up...'
)
def
init_config
(
self
,
app
):
"""Initialize configuration."""
...
...
docker-compose.full.yml
View file @
fac7fd6a
version
:
"
3.7
"
version
:
"
2.3
"
services
:
cern-search-api
:
build
:
...
...
@@ -8,12 +8,16 @@ services:
container_name
:
${CONTAINER_NAME}
volumes
:
-
./:/opt/invenio/src:delegated
-
cern_search_rest_api.egg-info:/opt/invenio/src/cern_search_rest_api.egg-info
ports
:
-
"
5000:5000"
depends_on
:
-
elasticsearch
-
redis
-
postgres
elasticsearch
:
condition
:
service_healthy
redis
:
condition
:
service_started
postgres
:
condition
:
service_started
networks
:
-
default
env_file
:
...
...
@@ -30,6 +34,11 @@ services:
-
default
volumes
:
-
es-data:/usr/share/elasticsearch/data
healthcheck
:
test
:
[
"
CMD"
,
"
curl"
,
"
-f"
,
"
localhost:9200/_cluster/health?wait_for_status=green"
]
interval
:
30s
timeout
:
30s
retries
:
5
kibana
:
image
:
docker.elastic.co/kibana/kibana-oss:6.2.4
...
...
@@ -81,3 +90,4 @@ volumes:
nginx-run
:
nginx-cache
:
nginx-tls
:
cern_search_rest_api.egg-info
:
docker-compose.yml
View file @
fac7fd6a
...
...
@@ -29,6 +29,8 @@ services:
redis
:
image
:
redis:5.0.6
ports
:
-
6379:6379
networks
:
-
default
...
...
setup.cfg
View file @
fac7fd6a
...
...
@@ -7,4 +7,4 @@
# under the terms of the MIT License; see LICENSE file for more details.
[aliases]
test = pytest
\ No newline at end of file
test = pytest
tests/conftest.py
View file @
fac7fd6a
...
...
@@ -21,5 +21,5 @@ from invenio_app.factory import create_api
def
app_config
(
app_config
):
del
app_config
[
'SECRET_KEY'
]
del
app_config
[
'SECURITY_PASSWORD_SALT'
]
app_config
[
'LOGGING_CONSOLE_LEVEL'
]
=
'DEBUG'
return
app_config
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment