diff --git a/.dockerignore b/.dockerignore index 7266003c2..d3e09b275 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,6 +8,7 @@ __pycache__/ .Python *.so +# Private files .env* **/.env* .invenio.private* @@ -15,20 +16,36 @@ docker/nginx_local/samlPrivateKey.key docker/nginx_local/samlCertificate.key docker-compose* +# Cache directories +.mypy_cache/ +**/.mypy_cache/ +.pytest_cache/ +**/.pytest_cache/ +.ruff_cache/ +**/.ruff_cache/ + +# Git and vscode directories .git/ **/.git* .github/ **/.github* -.pytest_cache/ -**/.pytest_cache/ .vscode/ + +# Logs logs/* **/test_logs **/logs + +# Scripts scripts/experiments scripts/sample_files + +# Build artifacts +build/ site/build site/kcworks.egg-info + +# Static files static/admin static/dist static/bootstrap diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c7dc7690c..e02fa9cb2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: push: branches: [ main, dev ] pull_request: - branches: [ main, dev ] + branches: [ main, dev, staging, production ] schedule: # * is a special character in YAML so you have to quote this string - cron: "0 3 * * 6" diff --git a/.gitignore b/.gitignore index 0271e18b5..cec03d889 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,8 @@ docs/build/ # Testing test.db .pytest_cache/ +.mypy_cache/ +.ruff_cache/ # Environments .venv diff --git a/Dockerfile b/Dockerfile index 9629ebf29..05a800f19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,6 +49,7 @@ RUN apt-get update && apt-get install -y \ libffi-dev \ uuid-dev \ wget \ + vim \ curl \ && rm -rf /var/lib/apt/lists/* \ && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ diff --git a/scripts/setup-services-production.sh b/scripts/setup-services-production.sh index 2069b0d4d..c1cbb0111 100644 --- a/scripts/setup-services-production.sh +++ b/scripts/setup-services-production.sh @@ -49,7 +49,7 @@ echo -e "${yellow}Creating the database...${clear}" invenio db init create echo -e "${yellow}Setting up s3 storage...${clear}" invenio files location s3-default s3://$INVENIO_S3_BUCKET_NAME --default; -echo -e "${yellow}Setting up admin user and role...${clear}" +echo -e "${yellow}Setting up admin roles and permissions...${clear}" invenio roles create admin invenio roles create administration invenio roles create administration-moderation @@ -68,7 +68,6 @@ echo -e "${yellow}Compiling translations...${clear}" pybabel compile -d /opt/invenio/src/translations echo -e "${yellow}Setting up task queues...${clear}" invenio queues declare -echo -e "${yellow}Creating administrator role...${clear}" if [ $fixtures==1 ] then echo -e "${yellow}Setting up fixtures in two stages (this may take a long time!!)...${clear}" diff --git a/scripts/setup-services.sh b/scripts/setup-services.sh index 30406e9cc..8458b6dab 100644 --- a/scripts/setup-services.sh +++ b/scripts/setup-services.sh @@ -20,14 +20,25 @@ select yn in "s3" "local"; do local ) echo -e "${yellow}Setting up local storage...${clear}"; invenio files location create --default default-location /opt/invenio/var/instance/data; break;; esac done -echo -e "${yellow}Setting up admin user and role...${clear}" +echo -e "${yellow}Setting up admin roles and permissions...${clear}" invenio roles create admin +invenio roles create administration +invenio roles create administration-moderation +invenio roles create admin-moderator invenio access allow superuser-access role admin +invenio access allow superuser-access role administration +invenio access allow superuser-access role administration-moderation +invenio access allow administration-access role administration +invenio access allow administration-moderation role administration-moderation echo -e "${yellow}Setting up OpenSearch index...${clear}" invenio index init echo -e "${yellow}Setting up custom metadata fields...${clear}" invenio rdm-records custom-fields init invenio communities custom-fields init +echo -e "${yellow}Compiling translations...${clear}" +pybabel compile -d /opt/invenio/src/translations +echo -e "${yellow}Setting up task queues...${clear}" +invenio queues declare echo -e "${yellow}Setting up fixtures in two stages (this may take a long time!!)...${clear}" invenio rdm fixtures invenio rdm-records fixtures & pid=$! @@ -39,14 +50,7 @@ do printf "\b%c" "${sp:i++%4:1}" sleep 0.1 done -echo -e "${yellow}Compiling translations...${clear}" -pybabel compile -d /opt/invenio/src/translations -echo -e "${yellow}Setting up task queues...${clear}" -invenio queues declare -echo -e "${yellow}Creating administrator role...${clear}" -invenio roles create administrator echo -e "${green}All done setting up services." -echo -e "${yellow}Building assets for Knowledge Commons Works instance...${clear}" -cd /opt/invenio/src/scripts -bash ./build-assets.sh +echo -e "${green}Building and symlinking assets..." +bash ./scripts/build-assets.sh echo -e "${green}Your instance is now ready to use.${clear}" \ No newline at end of file diff --git a/site/kcworks/webpack.py b/site/kcworks/webpack.py index ba1a3a537..2f66f4444 100644 --- a/site/kcworks/webpack.py +++ b/site/kcworks/webpack.py @@ -52,6 +52,7 @@ "dependencies": { "geopattern": "^1.2.3", "orcid-utils": "^1.2.2", + "react-invenio-forms": "3.5.2", }, "aliases": { "@js/invenio_modular_deposit_form_extras": (