Skip to content

reload/os2loop

 
 

Repository files navigation

OS2loop

Github Release PHP Version Build Status Read License Github downloads

OS2loop is a question-answering system built on Drupal 9. See os2.eu/produkt/os2loop (in Danish) for more information.

Installation

Production

Create local settings file with database connection:

cat <<'EOF' > web/sites/default/settings.local.php
<?php
$databases['default']['default'] = [
 'database' => getenv('DATABASE_DATABASE') ?: 'db',
 'username' => getenv('DATABASE_USERNAME') ?: 'db',
 'password' => getenv('DATABASE_PASSWORD') ?: 'db',
 'host' => getenv('DATABASE_HOST') ?: 'mariadb',
 'port' => getenv('DATABASE_PORT') ?: '',
 'driver' => getenv('DATABASE_DRIVER') ?: 'mysql',
 'prefix' => '',
];
EOF
composer install --no-dev --optimize-autoloader
vendor/bin/drush --yes site:install os2loop --existing-config
vendor/bin/drush --yes locale:update

You must also build the OS2Loop theme assets; see Building assets for details.

After installing the site you should check out Configuring OS2Loop for important and useful post-install instructions.

See OS2Loop modules for a complete list of custom OS2Loop modules.

Development

See docs/development for details on development.

docker-compose up --detach
docker-compose exec phpfpm composer install
docker-compose exec phpfpm vendor/bin/drush --yes site:install os2loop --existing-config
# Get the site url
echo "http://$(docker-compose port nginx 80)"
# Get admin sign in url
docker-compose exec phpfpm vendor/bin/drush --yes --uri="http://$(docker-compose port nginx 80)" user:login

Modules

Uses a dev version of views_flag_refresh since the module is not yet available on drupal.org

Mails

Mails are caught by MailHog and can be read on the url reported by

echo "http://$(docker-compose port mailhog 8025)"

Using symfony binary

docker-compose up --detach
symfony composer install
symfony php vendor/bin/drush --yes site:install os2loop --existing-config
# Start the server
symfony local:server:start --port=8000 --daemon
# Get the site url
echo "http://127.0.0.1:8000"
# Get admin sign in url
symfony php vendor/bin/drush --uri=https://127.0.0.1:8000 user:login

Fixtures

We have fixtures for all content types.

To load all content type fixtures, run:

# Find and enable all fixtures modules
vendor/bin/drush --yes pm:enable $(find web/profiles/custom/os2loop/modules/ -type f -name 'os2loop_*_fixtures.info.yml' -exec basename -s .info.yml {} \;)
# Load the fixtures
vendor/bin/drush --yes content-fixtures:load
# Uninstall all fixtures modules
vendor/bin/drush --yes pm:uninstall content_fixtures

Updates

composer install --no-dev --optimize-autoloader
vendor/bin/drush --yes updatedb
vendor/bin/drush --yes config:import
vendor/bin/drush --yes locale:update
vendor/bin/drush --yes cache:rebuild

Translations

Import translations by running

(cd web && ../vendor/bin/drush locale:import --type=customized --override=none da profiles/custom/os2loop/translations/translations.da.po)

Export translations by running

(cd web && ../vendor/bin/drush locale:export da --types=customized > profiles/custom/os2loop/translations/translations.da.po)

Open web/profiles/custom/os2loop/translations/translations.da.po with the latest version of Poedit to clean up and then save the file.

See https://medium.com/limoengroen/how-to-deploy-drupal-interface-translations-5653294c4af6 for further details.

Coding standards

composer coding-standards-check
composer coding-standards-apply
docker run --volume ${PWD}:/app --workdir /app node:latest yarn install
docker run --volume ${PWD}:/app --workdir /app node:latest yarn coding-standards-check
docker run --volume ${PWD}:/app --workdir /app node:latest yarn coding-standards-apply

GitHub Actions

We use GitHub Actions to check coding standards whenever a pull request is made.

Before making a pull request you can run the GitHub Actions locally to check for any problems:

Install act and run

act -P ubuntu-latest=shivammathur/node:focal pull_request

(cf. https://github.com/shivammathur/setup-php#local-testing-setup).

Twigcs

To run only twigcs:

composer coding-standards-check/twigcs

But this is also a part of

composer coding-standards-check

Build assets

docker run --volume ${PWD}:/app --workdir /app node:latest yarn install
docker run --volume ${PWD}:/app --workdir /app node:latest yarn encore dev

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Twig 47.6%
  • PHP 46.7%
  • SCSS 4.8%
  • JavaScript 0.8%
  • Shell 0.1%
  • CSS 0.0%