Development Environment Setup¶
Prerequisites¶
Local installation of Docker for Mac/Windows/Linux
Knowledge of Git procedures
Knowledge of setting environment variables
Knowledge of
docker-compose
utility.
Local Development Environment Setup¶
Clone the repo to your local machine in the desired folder location:
$ git clone https://github.com/ndlib/presqt.gitExport required ENV_VARS:
ENVIRONMENT: Should be either
production
ordevelopment
SECRET_KEY: A Django “secret key” value.
# Example Exportation $ export ENVIRONMENT=development $ export SECRET_KEY=y4xgryt7ex9g+4mcs4=^sg5afp3lz#=94eb6=6o6l61o=a31y_hExport optional ENV_VARS for testing:
CURATE_ND_TEST_TOKEN: The test token for Curate’s API.
GITHUB_TEST_USER_TOKEN: The test token for GitHub’s API.
OSF_TEST_USER_TOKEN: The test token for OSF’s API.
OSF_PRIVATE_USER_TOKEN: The private test token for OSF’s API.
OSF_UPLOAD_TEST_USER_TOKEN: The upload test token for OSF’s API.
OSF_PRESQT_FORK_TOKEN: The PresQT fork user test token for OSF’s API.
ZENODO_TEST_USER_TOKEN: The test token for Zenodo’s API.
GITLAB_TEST_USER_TOKEN: The test token for GitLab’s API.
FIGSHARE_TEST_USER_TOKEN: The test token for FigShare’s API.
Note
Contact an administrator to get the target test tokens.
4. Executedocker-compose
up within the repo’s base folder.$ docker-compose up --build
Navigate to https://localhost/api_v1/ in your browser.
Cron Container¶
There is now a third docker container that is responsible for running clean up tasks at specified times. It has been implemented in development to run the delete_outdated_mediafiles command every 15 minutes. The command has also been altered slightly to delete any mediafiles held in these directories when you are in a development environment. The command is set to run daily at 4:30am for our other servers.