Skip to content

eLife is an open-access journal that publishes promising research in the life and biomedical sciences

License

Notifications You must be signed in to change notification settings

scottaubrey/journal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eLife Journal

Build Status

Dependencies

Windows - tips and tricks When using Windows to bypass the main errors we recommend to follow the next :
  1. Before you cloned the repo, make sure that you configure git to use the correct line endings.

  2. Make sure you use Windows Linux Subsystem (WSL) or at least git bash.

  3. Use the recommended versions for PHP + extensions and Composer :

    • PHP 7.3.33-7+ubuntu22.04.1+deb.sury.org+2 (cli) (built: Sep 29 2022 22:23:16) ( NTS )

      How to install : Guide 1 / Guide 2

    • Composer version 1.10.26 2022-04-13 16:39:56

      How to install : Step 1 & Step 2

Docker Installation - Running the site locally

  1. Run composer install to generate vendor files locally
  2. Run docker-compose up --build
  3. Open http://localhost:8080 in your browser.

To start/restart the containers use these commands: docker-compose down --volumes --remove-orphans && docker-compose up --build

Important : Creating composer.lock on local and permanent updates to composer files in general should only be done from the container, be aware that if this is done from local can generate additional errors. To avoid any errors running composer update in the container is safer than running it in the local dev env. ( ex: docker-compose run composer update elife/patterns )

Changing configuration

When running the site locally via Docker, the parameters are supplied by /.docker/parameters.yaml.

To change configuration that is supplied by an environment variable, pass in the environment variable at start up. For example, to change the API URL: docker-compose down --volumes --remove-orphans && API_URL=https://prod--gateway.elifesciences.org docker-compose up --build.

Manual Installation (may or may not work - better use docker)

  1. Create app/config/parameters.yml from app/config/parameters.yml.dist
  2. npm install
  3. composer install
  4. node_modules/.bin/gulp
  5. bin/console assets:install --symlink

Regenerating critical CSS

docker-compose run critical_css

Running the tests

To run all unit tests as in ci:

docker-compose -f docker-compose.yml -f docker-compose.ci.yml run ci .ci/phpunit

To run a single test:

APP_ENV=ci docker-compose run app vendor/bin/phpunit --filter AboutControllerTest

Running Behat

Behat needs the ci image to run, so it needs to build an additional image and use the ci configuration:

docker-compose -f docker-compose.yml -f docker-compose.ci.yml up --build --detach

To run all scenarios:

docker-compose -f docker-compose.yml -f docker-compose.ci.yml run ci .ci/behat

To run a single scenario:

docker-compose -f docker-compose.yml -f docker-compose.ci.yml run ci vendor/bin/behat features/article.feature

If you have made changes to the code and want to re-run a test then you will need to rebuild your docker containers:

docker-compose -f docker-compose.yml -f docker-compose.ci.yml down && docker-compose -f docker-compose.yml -f docker-compose.ci.yml up --build --detach

Reproduce a ci failure

docker-compose -f docker-compose.yml -f docker-compose.ci.yml down -v
SELENIUM_IMAGE_SUFFIX=-debug docker-compose -f docker-compose.yml -f docker-compose.ci.yml up --build
docker-compose -f docker-compose.yml -f docker-compose.ci.yml run ci .ci/behat

Working on Content Alerts

In all but the production environment the CiviCRM client is a mock. This allows the developer to demonstrate the various screens without needing to make changes to a working CiviCRM instance.

Visit http://localhost:8080/content-alerts:

  • Use [email protected] to trigger existing subscription scenario
  • Use any other email to trigger subscription confirmation

For user preference interface:

Expired link interface:

Unsubscribe/optout interface:

To work on the integration with CiviCRM you will have to set the environment variable APP_ENV=prod. And also adjust the values in .docker/parameters.yml for crm_api_key, crm_api_site_key, google_api_client.refresh_token and google_api_client.optout_unsubscribe_spreadsheet_id to be the same as in production.

About

eLife is an open-access journal that publishes promising research in the life and biomedical sciences

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 94.3%
  • Twig 3.8%
  • Gherkin 1.2%
  • JavaScript 0.5%
  • Shell 0.2%
  • Dockerfile 0.0%