Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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"

7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
Expand All @@ -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/*
Expand Down Expand Up @@ -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
EXPOSE 80
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: '2'
version: '3'

services:
web:
image: datacite/viringo
image: frdr-dfdr/viringo
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I'm finally looking at this, I think this is the one line that would bring us into conflict with upstream and wouldn't be likely to be merged -- can we change this with an ansible variable or something?

build: .
ports:
- "8091:80"
- "2291:22"
volumes:
- ./:/home/app/webapp/
env_file:
- .env
- viringo.env
3 changes: 2 additions & 1 deletion vendor/docker/webapp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -19,4 +20,4 @@ server {
root /home/app/vendor/middleman/build;
index index.html;
}
}
}
2 changes: 1 addition & 1 deletion viringo/catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def identify(self):
<scheme>oai</scheme>
<repositoryIdentifier>""" + config.OAIPMH_IDENTIFIER + """</repositoryIdentifier>
<delimiter>:</delimiter>
<sampleIdentifier>oai""" + config.OAIPMH_IDENTIFIER + """:1</sampleIdentifier>
<sampleIdentifier>oai:""" + config.OAIPMH_IDENTIFIER + """:1</sampleIdentifier>
</oai-identifier>
"""

Expand Down
2 changes: 1 addition & 1 deletion viringo/oai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions viringo/services/frdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down