Skip to content

Commit

Permalink
install: project installation
Browse files Browse the repository at this point in the history
* NEW invenio installation
* NEW bootstrap 4 framework
* NEW application layout
* NEW sonar configuration
* NEW tests run
* Testing invenio

Signed-off-by: Sébastien Délèze <[email protected]>
  • Loading branch information
Sébastien Délèze committed May 16, 2019
0 parents commit 3c557cc
Show file tree
Hide file tree
Showing 170 changed files with 22,487 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.git
*.gitignore

*.mo
*.pyc
*.swp
*.swo
*.~

.dockerignore
Dockerfile
docker-compose.yml
docker-compose-dev.yml

Procfile*
41 changes: 41 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 RERO.
#
# Swiss Open Access Repository is free software; you can redistribute it
# and/or modify it under the terms of the MIT License; see LICENSE file for
# more details.

root = true

[*]
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# Python files
[*.py]
indent_size = 4
# isort plugin configuration
known_first_party = sonar
multi_line_output = 2
default_section = THIRDPARTY
skip = .eggs

# RST files (used by sphinx)
[*.rst]
indent_size = 4

# CSS, HTML, JS, JSON, YML
[*.{css,html,js,json,yml}]
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_size = 2

# Dockerfile
[Dockerfile]
indent_size = 4
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# Idea software family
.idea/

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# end-to-end testing
.e2e_screenshots

# Translations
*.mo

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Vim swapfiles
.*.sw?

# Virtual studio pref
.vscode

# MAC
.DS_Store
74 changes: 74 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 RERO.
#
# Swiss Open Access Repository is free software; you can redistribute it
# and/or modify it under the terms of the MIT License; see LICENSE file for
# more details.

addons:
chrome: stable # https://docs.travis-ci.com/user/chrome

# Chrome Webdriver fails if not on sudo
# See https://github.com/travis-ci/travis-ci/issues/8836
sudo: true

dist: trusty # Chrome driver fails if not trusty dist

notifications:
email: # sent to the committer and the author
on_success: never # default: always
on_failure: always # default: always

language: python

matrix:
fast_finish: true

cache:
- pip

services:
- docker

env:
global:
# Print screenshots to console output
- E2E_OUTPUT=base64
# Enable end-to-end tests
- E2E=no
matrix:
- REQUIREMENTS=prod E2E=yes
- REQUIREMENTS=qa

python:
- "3.6"

before_install:
# Stop default travis services
- "sudo service mysql stop"
- "sudo service postgresql stop"
# Start docker services
- "docker-compose up -d"
# Chrome webdriver for Selenium
- "PATH=$PATH:$HOME/webdrivers"
- "if [ ${E2E} == 'yes' ] && [ ! -f $HOME/webdrivers/chromedriver ]; then wget https://chromedriver.storage.googleapis.com/2.31/chromedriver_linux64.zip -P $HOME/webdrivers; unzip -d $HOME/webdrivers $HOME/webdrivers/chromedriver_linux64.zip; fi"
- "nvm install 6; nvm use 6"
- "travis_retry pip install --upgrade pip setuptools py pipenv"
- "travis_retry pip install twine wheel coveralls"

install:
- "./scripts/bootstrap"

before_script:
# https://docs.travis-ci.com/user/gui-and-headless-browsers/
- "export DISPLAY=:99.0"
- "if [ ${E2E} == 'yes' ]; then sh -e /etc/init.d/xvfb start; sleep 3; fi"
# Allow services running inside docker to start
- "./docker/wait-for-services.sh"

script:
- ./run-tests.sh # E2E tests are skipped if E2E env is set to 'no'

after_success:
- coveralls
33 changes: 33 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 RERO.
#
# Swiss Open Access Repository is free software; you can redistribute it
# and/or modify it under the terms of the MIT License; see LICENSE file for
# more details.

# TODO: Transifex integration
#
# 1) Create message catalog:
# $ python setup.py extract_messages
# $ python setup.py init_catalog -l <lang>
# $ python setup.py compile_catalog
# 2) Ensure project has been created on Transifex under the rero/sonar
# organisation.
# 3) Install the transifex-client
# $ pip install transifex-client
# 4) Push source (.pot) and translations (.po) to Transifex
# $ tx push -s -t
# 5) Pull translations for a single language from Transifex
# $ tx pull -l <lang>
# 6) Pull translations for all languages from Transifex
# $ tx pull -a

[main]
host = https://www.transifex.com

[rero/sonar-messages]
file_filter = sonar/translations/<lang>/LC_MESSAGES/messages.po
source_file = sonar/translations/messages.pot
source_lang = en
type = PO
11 changes: 11 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
..
Copyright (C) 2019 RERO.
Swiss Open Access Repository is free software; you can redistribute it
and/or modify it under the terms of the MIT License; see LICENSE file for
more details.

Authors
=======

- RERO
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
..
Copyright (C) 2019 RERO.
Swiss Open Access Repository is free software; you can redistribute it
and/or modify it under the terms of the MIT License; see LICENSE file for
more details.

Changes
=======
124 changes: 124 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
..
Copyright (C) 2019 RERO.
Swiss Open Access Repository is free software; you can redistribute it
and/or modify it under the terms of the MIT License; see LICENSE file for
more details.

Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/rero/sonar/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

Swiss Open Access Repository could always use more documentation, whether as part of the
official Swiss Open Access Repository docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at
https://github.com/rero/sonar/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `sonar` for local development.

1. Fork the `rero/sonar` repo on GitHub.
2. Clone your fork locally:

.. code-block:: console
$ git clone [email protected]:your_name_here/sonar.git
3. Install your local copy. Assuming you have
`pipenv <https://docs.pipenv.org/install/#installing-pipenv>`_, installed, this is how you
set up your fork for local development:

.. code-block:: console
$ cd sonar/
$ pipenv run install -e .[all]
4. Create a branch for local development:

.. code-block:: console
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.

5. When you're done making changes, check that your changes pass tests:

.. code-block:: console
$ ./run-tests.sh
The tests will provide you with test coverage and also check PEP8
(code style), PEP257 (documentation), flake8 as well as build the Sphinx
documentation and run doctests.

6. Commit your changes and push your branch to GitHub:

.. code-block:: console
$ git add .
$ git commit -s
-m "component: title without verbs"
-m "* NEW Adds your new feature."
-m "* FIX Fixes an existing issue."
-m "* BETTER Improves and existing feature."
-m "* Changes something that should not be visible in release notes."
$ git push origin name-of-your-bugfix-or-feature
7. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests and must not decrease test coverage.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring.
3. The pull request should work for Python 2.7, 3.3, 3.4 and 3.5. Check
https://travis-ci.org/rero/sonar/pull_requests
and make sure that the tests pass for all supported Python versions.
Loading

0 comments on commit 3c557cc

Please sign in to comment.