diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ae6df7d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +# Tags in this file MUST match GitLab runner configured tags else the jobs will not run. +default: + image: docker + #tags? +variables: + DOCKER_HOST: tcp://docker:2375 + DOCKER_TLS_CERT_DIR: "" + +services: + - docker:19.03.12-dind + +before_script: + - docker info + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + +script: + - echo "GitLab Viringo Docker image build steps" + diff --git a/Dockerfile b/Dockerfile index fb06843..a26880f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM phusion/passenger-full:1.0.6 +FROM phusion/passenger-full:1.0.11 # Use baseimage-docker's init process. CMD ["/sbin/my_init"] @@ -13,8 +13,7 @@ ADD "https://bootstrap.pypa.io/get-pip.py" /tmp/get-pip.py RUN python3 /tmp/get-pip.py # Fetch pipenv install script and run -ADD "https://raw.githubusercontent.com/kennethreitz/pipenv/master/get-pipenv.py" /tmp/get-pipenv.py -RUN python3 /tmp/get-pipenv.py +RUN pip install pipenv # Cleanup RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -63,4 +62,4 @@ COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh COPY vendor/docker/20_always_restart.sh /etc/my_init.d/20_always_restart.sh # Expose web -EXPOSE 80 \ No newline at end of file +EXPOSE 80 diff --git a/docker-compose.yml b/docker-compose.yml index 09ed2a1..d489895 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ -version: '2' +version: '3' services: web: - image: datacite/viringo + image: frdr-dfdr/viringo build: . ports: - "8091:80" @@ -10,4 +10,4 @@ services: volumes: - ./:/home/app/webapp/ env_file: - - .env + - viringo.env diff --git a/vendor/docker/webapp.conf b/vendor/docker/webapp.conf index 39e1dae..4a69a4c 100644 --- a/vendor/docker/webapp.conf +++ b/vendor/docker/webapp.conf @@ -11,6 +11,7 @@ server { passenger_restart_dir /home/app/webapp/tmp; passenger_app_type wsgi; passenger_startup_file viringo/wsgi.py; + passenger_base_uri /viringo; include /etc/nginx/conf.d/cors.conf; @@ -19,4 +20,4 @@ server { root /home/app/vendor/middleman/build; index index.html; } -} \ No newline at end of file +} diff --git a/viringo/catalogs.py b/viringo/catalogs.py index cdc9c4b..5c5dcec 100644 --- a/viringo/catalogs.py +++ b/viringo/catalogs.py @@ -305,7 +305,7 @@ def identify(self): oai """ + config.OAIPMH_IDENTIFIER + """ : - oai""" + config.OAIPMH_IDENTIFIER + """:1 + oai:""" + config.OAIPMH_IDENTIFIER + """:1 """ diff --git a/viringo/oai.py b/viringo/oai.py index 5e4fbc7..1f9acab 100644 --- a/viringo/oai.py +++ b/viringo/oai.py @@ -150,7 +150,7 @@ def index(): dom = minidom.parseString(xml) process_instruction = dom.createProcessingInstruction( 'xml-stylesheet', - 'type="text/xsl" href="/static/oaitohtml.xsl"' + 'type="text/xsl" href="/viringo/static/oaitohtml.xsl"' ) root = dom.firstChild dom.insertBefore(process_instruction, root) diff --git a/viringo/services/frdr.py b/viringo/services/frdr.py index ffaf422..0855e23 100644 --- a/viringo/services/frdr.py +++ b/viringo/services/frdr.py @@ -238,8 +238,9 @@ def build_metadata(data): result = Metadata() # Construct identifier compliant with OAI spec - namespace = data['repo_oai_name'] - result.identifier = "oai:" + namespace + ":" + data['local_identifier'] + if not data['repo_oai_name'] or not data['local_identifier']: + return None + result.identifier = "oai:" + data['repo_oai_name'] + ":" + data['local_identifier'] # Here we want to parse a ISO date but convert to UTC and then remove the TZinfo entirely # This is because OAI always works in UTC.