$ sudo mount /dev/sdb1 /mnt
$ vagrant box add -n iugw2017-demosite-web /mnt/iugw2017-demosite-web.box
Start Vagrant
$ git clone https://github.com/inveniosoftware/iugw2017
$ cd iugw2017
$ vagrant up
$ vagrant destroy
# Vagrantfile for IUGW2017.
Vagrant.configure("2") do |config|
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
config.vm.define "web" do |web|
web.vm.box = "iugw2017-demosite-web"
web.vm.hostname = 'web'
web.vm.network "forwarded_port", guest: 80, host: 80
web.vm.network "forwarded_port", guest: 5000, host: 5000
web.vm.network "private_network", ip: ENV.fetch('INVENIO_WEB_HOST','192.168.50.10')
web.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "4028"]
vb.customize ["modifyvm", :id, "--cpus", 2]
end
end
end
$ vagrant up
User guide
Customize Invenio v3
http://invenio.readthedocs.io/en/iugw2017/usersguide/tutorial/customize.html
$ laptop> vagrant ssh web
$ vagrant> workon invenio
$ vagrant> cd /vagrant/2-customization/invenio-beauty
$ vagrant> pip install .
$ vagrant> invenio collect
$ vagrant> invenio run -h 0.0.0.0
Open invenio.cfg
~/.virtualenv/var/instance/invenio.cfg
$ cdvirtualenv var/instance/
$ vim invenio.cfg
add the following code
THEME_LOGO = 'images/unicorn.png'
THEME_FRONTPAGE_TITLE = 'Unicorn Institute'
in
~/.virtualenv/var/instance/invenio.cfg
now run on your terminal
$ invenio run -h 0.0.0.0
Open invenio.cfg
~/.virtualenv/var/instance/invenio.cfg
$ cdvirtualenv var/instance/
$ vim invenio.cfg
add the following code
from invenio_records_rest.facets import terms_filter
RECORDS_REST_FACETS = {
'marc21': {
'aggs': {
'author': {
'terms': {
'field': 'main_entry_personal_name.personal_name'
}
}
},
'post_filters': {
'author': terms_filter(
'main_entry_personal_name.personal_name'
)
}
}
}
now run on your terminal
$ invenio run -h 0.0.0.0
Open invenio.cfg
~/.virtualenv/var/instance/invenio.cfg
$ cdvirtualenv var/instance/
$ vim invenio.cfg
add the following code
RECORDS_REST_SORT_OPTIONS = {
'records': {
'title': {
'fields': ['title_statement.title'],
'title': 'Record title',
'order': 1,
}
}
}
in
~/.virtualenv/var/instance/invenio.cfg
now run on your terminal
$ invenio run -h 0.0.0.0
open invenio.cfg
~/.virtualenv/var/instance/invenio.cfg
$ cdvirtualenv var/instance/
$ vim invenio.cfg
add the following code
RECORDS_UI_ENDPOINTS = {
"recid": {
"pid_type": "recid",
"route": "/records/",
"template": "invenio_beauty/detail.html"
},
}
in
~/.virtualenv/var/instance/invenio.cfg
now run on your terminal
$ invenio run -h 0.0.0.0
open invenio.cfg
~/.virtualenv/var/instance/invenio.cfg
$ cdvirtualenv var/instance/
$ vim invenio.cfg
add the following code
SEARCH_UI_JSTEMPLATE_RESULTS = 'templates/invenio_beauty/results.html'
in
~/.virtualenv/var/instance/invenio.cfg
now run on your terminal
$ invenio run -h 0.0.0.0
open invenio.cfg
~/.virtualenv/var/instance/invenio.cfg
$ cdvirtualenv var/instance/
$ vim invenio.cfg
add the following code
THEME_FRONTPAGE_TEMPLATE = 'invenio_beauty/home.html'
in
~/.virtualenv/var/instance/invenio.cfg
now run on your terminal
$ invenio run -h 0.0.0.0
$ cd /vagrant/iugw2017/2-customization
$ cat final.cfg >> ~/.virtualenvs/invenio/var/instance/invenio.cfg
paste to the following file
~/.virtualenv/var/instance/invenio.cfg