Giter Site home page Giter Site logo

un-ocha / iasc8 Goto Github PK

View Code? Open in Web Editor NEW
0.0 8.0 2.0 10.13 MB

The IASC corporate website in Drupal 8 flavour.

Home Page: https://interagencystandingcommittee.org/

Shell 0.75% PHP 57.04% HTML 0.61% JavaScript 1.75% Gherkin 0.15% Dockerfile 0.29% Makefile 0.14% Twig 31.16% SCSS 0.83% CSS 7.29%

iasc8's Introduction

IASC 8 | Develop branch Build Status

This is the IASC Drupal 8 site. The code for this project is managed with composer.

To install security updates for Drupal, run composer update drupal/core webflo/drupal-core-require-dev --with-dependencies.

Installation

The html directory is the document root. The vendor directories contains libraries that are required for the site to function. These libraries

  • Checkout the repository.
  • Run composer install. This will download Drupal core, contributed modules, contributed themes and libraries.
  • Deploy the html and vendor directories to the web server(s).

For local development, add this line to settings.local.php: $config['config_split.config_split.config_dev']['status'] = TRUE; After importing a fresh database, run drush cim to enable devel, database log and stage_file_proxy.

Initialisation

Use drush to bootstrap your site and import the initial configuration from the config subdirectory.

drush -y si --admin-password="your admin password" --db-url=mysql://drupal:[email protected]/drupal minimal
drush -y cset system.site uuid $(grep uuid config/system.site.yml | awk '{print $2}')
drush -y cim --source=config
drush php-eval 'node_access_rebuild();'
drush cr

Testing

Remote

Automatic testing is run via Travis CI. Code syntax, style and quality are inspected and finally behat installs an instance of the site and tests that logins work.

With a small alteration, these tests could run via GitHub Actions.

Locally

fin exec "vendor/bin/phpunit --debug --colors --printer '\\Drupal\\Tests\\Listeners\\HtmlOutputPrinter'"

Config

// Docksal DB connection settings.
$databases['default']['default'] = array (
  'database' => 'default',
  'username' => 'user',
  'password' => 'user',
  'host' => 'db',
  'driver' => 'mysql',
);

$databases['migrate']['default'] = array (
  'database' => 'd7',
  'username' => 'user',
  'password' => 'user',
  'host' => 'db',
  'driver' => 'mysql',
);

Migrate

Install from config

fin drush --verbose -y si --existing-config --account-pass="admin"

Create skeleton

drush migrate-upgrade --legacy-db-url=mysql://user:user@db/d7 --configure-only

Import

see migrate.sh

Files

drush php-eval " \Drupal::config('migrate.migration.d7_file')->set('destination.source_base_path', 'html/sites/default/files/d7')->save();"
mkdir -p html/sites/default/files/d7/sites/default/files
cp -r d7_source html/sites/default/files/d7/sites/default/files/

Optionally convert to media: https://thinktandem.io/blog/2019/04/04/migrating-a-drupal-7-file-to-a-drupal-8-media-entity/

Update core

fin composer outdated drupal/core
fin composer update drupal/core --with-dependencies
fin drush updb -y && fin drush cr

Update contrib

fin composer outdated drupal/*
fin composer update drupal/* --with-dependencies
fin drush updb -y && fin drush cr

HID

Create and add keys.

mkdir -p keys
cd keys
openssl genpkey -algorithm RSA -out hid.rsa -pkeyopt rsa_keygen_bits:2048
openssl rsa -pubout -in hid.rsa -out hid.rsa.pub
cd ..
docker cp keys/hid.rsa f574cbb816a7:srv/www/keys/
docker cp keys/hid.rsa.pub f574cbb816a7:srv/www/keys/

Create test site and test user

docker-compose exec dev node ./commands/createDummyClient.js --url=https://iasc8.local.docksal/ --redirectUrl=https://iasc8.local.docksal/user/login/hid/callback
docker-compose exec dev node ./commands/createDummyUser.js [email protected] --password=pwd

Update Drupal config

fin drush config-set -y social_auth_hid.settings base_url http://hid.iasc8.local.docksal
fin drush config-set -y social_auth_hid.settings client_id client
fin drush config-set -y social_auth_hid.settings client_secret clientsecret

iasc8's People

Contributors

left23 avatar attiks avatar lazysoundsystem avatar cafuego avatar unocha-jenkins avatar dependabot[bot] avatar rupl avatar

Watchers

Lucian avatar  avatar  avatar James Cloos avatar Emma Jane avatar Serban Teodorescu 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.