-
Clone project using SSH key:
git clone git@github.com:eaudeweb/scratch.git
-
Copy docker example files:
cd scratch/ cp docker-compose.override.yml.example docker-compose.override.yml cp docker/app.env.example docker/app.env cp docker/db.env.example docker/db.env cp docker/redis.env.example docker/redis.env cp docker/tika.env.example docker/tika.env
NOTE: LDAP variables in
app.env
must be configured manually
-
Create the stack and start it:
docker-compose up -d
-
Verify if the containers were created:
docker-compose ps
-
Go into application container:
docker exec -it scratch.app sh
-
Load fixtures:
python manage.py loaddata fixture app/fixtures/*.json
-
Run server:
python manage.py runserver 0.0.0.0:8000
If you want to use NGINX to serve the project you need to do the following:
Comment the web service the ports in docker-compose.yml
web:
...
ports:
- 8000:8000
Create docker-compose.override.yml from docker-compose.override.yml.nginx.example
cp docker-compose.override.yml.nginx.example docker-compose.override.yml
Create the stack and start it:
docker-compose up
Install the test requirements
pip install -r requirements-dev.txt
Run the test suite
python manage.py test --settings=scratch.test_settings
If you need to debug ElasticSearch during development, you can connect to the web client at http://localhost:1358/?appname=%2A&url=http://localhost:9200/
-
Bootstrap checks failed: When starting the Elasticsearch container, this error may ocurr. The following command should fix it.
sudo sysctl -w vm.max_map_count=262144
- add_award: Adds Contract Awards for expired UNGM tenders
- deadline_notifications: Sends e-mails with favourite tenders that have deadline in DEADLINE_NOTIFICATIONS days
- delete_expired_tenders: Deletes tenders from archive with deadline passed since DELETE_EXPIRED_DAYS days ago or more
- notify: Sends an e-mail for every new tender or winner(default) or an e-mail with all new tenders and winners(digest parameter specified);
- notify_favourites: Sends e-mails for favourites tenders, according to digest parameter described previously
- notify_keywords: Sends e-mails for tenders with keywords, according to digest parameter described previously
- remove_unnecessary_newlines: Removes newlines Vendors' names
- update_ted: Add new TED tenders, according to days_ago parameter or beginning with latest published date from database, if not specified
- update_ungm: Add new UNGM tenders, according to days_ago parameter or beginning with latest published date from database, if not specified