Git Product home page Git Product logo

profile's Introduction

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)"

Fixtures

We have fixtures for all content types.

To load all content type fixtures, run:

# Find and enable all fixtures modules
docker-compose exec phpfpm vendor/bin/drush --yes pm:enable $(find web/profiles/custom/os2loop/modules/ -type f -name 'os2loop_*_fixtures.info.yml' -exec basename -s .info.yml {} \;)
# Disable "Entity Reference Integrity Enforce" module to be able to delete (purge) content before loading fixtures.
docker-compose exec phpfpm vendor/bin/drush --yes pm:uninstall entity_reference_integrity_enforce
# Load the fixtures
docker-compose exec phpfpm vendor/bin/drush --yes content-fixtures:load
# Uninstall all fixtures modules
docker-compose exec phpfpm vendor/bin/drush --yes pm:uninstall content_fixtures
# Enable "Entity Reference Integrity Enforce" module
docker-compose exec phpfpm vendor/bin/drush --yes pm:enable entity_reference_integrity_enforce

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:16.13.2 yarn install
docker run --volume ${PWD}:/app --workdir /app node:16.13.2 yarn coding-standards-check
docker run --volume ${PWD}:/app --workdir /app node:16.13.2 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:16.13.2 yarn install
docker run --volume ${PWD}:/app --workdir /app node:16.13.2 yarn encore dev

profile's People

Contributors

agger-magenta avatar alexandermomtaz avatar cableman avatar jaxbot avatar lapeth avatar magnify avatar mamdouhweb avatar martinyde avatar merlinofchaos avatar mfprimo avatar perthaarhus avatar pitbulk avatar rimi-itk avatar sethlundst avatar sethmagenta avatar smalyshev avatar syastrov avatar thomasjohansen avatar tuj avatar turegjorup avatar wadsager avatar zorp avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.