Skip to content

Commit

Permalink
portal: Take the code of the portal to a different repo
Browse files Browse the repository at this point in the history
  • Loading branch information
psaiz committed Mar 4, 2024
1 parent 81d791e commit 335c72d
Show file tree
Hide file tree
Showing 19,088 changed files with 51 additions and 44,966 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
122 changes: 0 additions & 122 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,82 +25,6 @@ name: CI
on: [push, pull_request]

jobs:
lint-shellcheck:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Runs shell script static analysis
run: |
sudo apt-get install shellcheck
./run-tests.sh --check-shellscript
lint-black:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Check Python code formatting
run: |
pip install black
./run-tests.sh --check-black
lint-pycodestyle:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Check compliance with Python coding style conventions
run: |
pip install --upgrade pip
pip install pycodestyle
./run-tests.sh --check-pycodestyle
lint-pydocstyle:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Check compliance with Python docstring conventions
run: |
pip install --upgrade pip
pip install pydocstyle
./run-tests.sh --check-pydocstyle
lint-check-manifest:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Check Python manifest completeness
run: |
pip install --upgrade pip
pip install check-manifest
./run-tests.sh --check-manifest

check-fixtures:
runs-on: ubuntu-20.04
Expand All @@ -118,49 +42,3 @@ jobs:

- name: Check fixtures
run: ./run-tests.sh --check-fixtures

check-isort:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Check isort
run: |
pip install --upgrade pip
pip install isort
./run-tests.sh --check-isort
docker-build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Lint Dockerfile
run: docker run -i --rm hadolint/hadolint:v1.18.2 < Dockerfile

- name: Create certificates
run: ./scripts/generate-localhost-certificate.sh

- name: Build docker
run: ./run-tests.sh --check-docker-build

- name: Run pytest
run: docker-compose run --rm web ./run-tests.sh --check-pytest

- name: Codecov Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
31 changes: 22 additions & 9 deletions DEVELOPING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ Install with Docker
-------------------

One popular solution to develop the CERN Open Data instance locally is to use
Docker. For development purposes, please use the ``docker-compose-dev.yml``
configuration. The source code directory will be mounted in the container and
the system will be ready for "live editing". This is useful for active feature
development or for pull request integration purposes. A usage example:
Docker. Please use the ``docker-compose-dev.yml``. A usage example:

.. code-block:: console
$ ./scripts/generate-localhost-certificate.sh
$ docker compose -f docker-compose-dev.yml build
$ docker compose -f docker-compose-dev.yml up -d
$ docker exec -i -t opendatacernch-web-1 /code/scripts/populate-instance.sh
$ firefox http://0.0.0.0:5000/
Expand All @@ -43,6 +39,26 @@ will not be mounted in the container in this case. A usage example:
$ firefox http://0.0.0.0/
$ docker compose down -v
This will create a new instance of the portal, with the records that come out of the common package.
The next step would be to insert the data that comes from this repository.

.. code-block:: console
$ docker compose up -d
$ docker exec -i -t opendatacernch-web-1 cernopendata fixtures records -d /data/records
$ docker exec -i -t opendatacernch-web-1 cernopendata fixtures docs -d /data/docs
$ firefox http://0.0.0.0/
$ docker compose down -v
If you want to modify the portal itself (for instance, the JINJA templates or the schema of the objects), then the
recommended setup is to check out as well the repository for the code (in the same parent directory as this one), and
mount the code directory, so that the system is ready for "live editing". This is useful for active feature
development or for pull request integration purposes.

.. code-block:: console
$ ( cd .. && git clone https://github.com/cernopendata/cernopendata-portal.git )
$ sed -i '' 's/#\(.*# Uncomment this one to do "Live Editing"\)/\1/g' docker-compose.yml
Install with Podman
-------------------

Expand All @@ -63,10 +79,7 @@ An example of a Podman development session:
$ ./scripts/generate-localhost-certificate.sh
$ podman-compose -f docker-compose-dev.yml --podman-build-args='--format docker' build
$ podman-compose -f docker-compose-dev.yml up
$ podman exec -i -t opendatacernch_web_1 \
./scripts/populate-instance.sh --skip-docs --skip-glossary --skip-records
$ podman exec -i -t opendatacernch_web_1 \
cernopendata fixtures records --mode insert -f cernopendata/modules/fixtures/data/records/cms-primary-datasets.json
$ podman exec -i -t opendatacernch_web_1 /code/scripts/populate-instance.sh
$ firefox http://0.0.0.0:5000/
$ podman-compose -f docker-compose-dev.yml down -v
Expand Down
124 changes: 0 additions & 124 deletions Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions cernopendata/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions cernopendata/celery.py

This file was deleted.

13 changes: 0 additions & 13 deletions cernopendata/cli.py

This file was deleted.

Loading

0 comments on commit 335c72d

Please sign in to comment.