Skip to content

Commit 4c9d2c9

Browse files
authored
Merge pull request #32 from OS2Forms/develop
Merging develop into master to add os2forms_forloeb_profile and Docksal environment update
2 parents 2cb1ebd + 835560c commit 4c9d2c9

43 files changed

Lines changed: 4824 additions & 3589 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docksal/commands/build-forloeb

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
# Script reinstalling drupal from scratch based in os2forms_forloeb_profile.
3+
4+
# Trapping CTRL-C
5+
trap ctrl_c INT
6+
trap ctrl_c SIGINT
7+
trap ctrl_c SIGTERM
8+
9+
# Console colors
10+
red='\033[0;31m'
11+
green='\033[0;32m'
12+
green_bg='\033[42m'
13+
yellow='\033[1;33m'
14+
NC='\033[0m'
15+
16+
# Helper functions for console output
17+
echo-red () { echo -e "${red}$1${NC}"; }
18+
echo-green () { echo -e "${green}$1${NC}"; }
19+
echo-green-bg () { echo -e "${green_bg}$1${NC}"; }
20+
echo-yellow () { echo -e "${yellow}$1${NC}"; }
21+
22+
echo-yellow "Updating os2forms_forloeb module"
23+
fin composer update os2forms/os2forms_forloeb
24+
25+
echo-yellow "Updating composer.lock file"
26+
fin composer update --lock
27+
28+
echo-yellow "Fetching composer dependencies"
29+
fin composer install
30+
31+
echo-yellow "Installing drupal based on os2forms_forloeb_profile"
32+
if ! fin drush status bootstrap | grep -q Successful ; then
33+
echo "Drupal is not bootstrapped - starting site-install"
34+
fin drush si os2forms_forloeb_profile --db-url=mysql://root:root@db/default --account-pass=admin --site-name=OS2forms_Forløb -y -v
35+
36+
# Creating demo-users - BEGIN
37+
38+
fin drush ucrt forloeb-designer --mail="os2forms-forloeb-designer@example.com" --password="forloeb-designer"
39+
fin drush urol "forloeb_designer" forloeb-designer
40+
41+
fin drush ucrt flow-designer --mail="os2forms-flow-designer@example.com" --password="flow-designer"
42+
fin drush urol "flow_designer" flow-designer
43+
44+
fin drush ucrt medarbejder --mail="os2forms-medarbejder@example.com" --password="medarbejder"
45+
fin drush urol "medarbejder" medarbejder
46+
47+
fin drush ucrt sagsbehandler --mail="os2forms-sagsbehandler@example.com" --password="sagsbehandler"
48+
fin drush urol "sagsbehandler" sagsbehandler
49+
50+
fin drush ucrt leder --mail="os2forms-leder@example.com" --password="leder"
51+
fin drush urol "leder" leder
52+
53+
fin drush ucrt borger --mail="os2forms-borger@example.com" --password="borger"
54+
fin drush urol "borger" borger
55+
56+
fin drush ucrt virksomhed --mail="os2forms-virksomhed@example.com" --password="virksomhed"
57+
fin drush urol "virksomhed" virksomhed
58+
59+
# Creating demo-users - END
60+
61+
# Import of user interface translations. Never check for updates. Only use local translation source. Only overwrite imported translations.
62+
# Comment out the three lines to run install without importing translations
63+
fin drush locale-check
64+
fin drush locale-update
65+
# End import og translations
66+
67+
else
68+
echo "Drupal already bootstrapped - skipping install"
69+
fi
70+
71+
echo-yellow "Install os2forms_forloeb, run update.php and clear caches"
72+
fin drush en os2forms_forloeb -y
73+
fin drush updb -y
74+
fin drush cr

.docksal/docksal.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DOCKSAL_STACK=default
22
DOCROOT=web
3-
CLI_IMAGE="docksal/cli:2.6-php7.2"
3+
CLI_IMAGE="docksal/cli:2.11-php7.4"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ simplesamlphp/*
4040
/.docksal/commands/*
4141
!/.docksal/commands/init
4242
!/.docksal/commands/rebuild-test
43+
!/.docksal/commands/build-forloeb
4344

4445
# docker stuff
4546
.docker/php/logs/*.log
@@ -59,3 +60,4 @@ simplesamlphp/*
5960
/robots.txt
6061
/update.php
6162
/web.config
63+
/.gitattributes

README.md

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,31 @@ These instructions will get you a copy of the project up and running on your loc
5959
fin start
6060
```
6161

62-
4. Install dependencies and enable modules
62+
4. Create local settings
6363
```sh
64-
fin rebuild-test
64+
cp web/sites/example.settings.local.php web/sites/default/settings.local.php
65+
```
66+
67+
5. Add file permission fix to settings.local.php. See https://docs.docksal.io/apps/drupal/#file-permissions
68+
```php
69+
// web/sites/default/settings.local.php
70+
71+
$settings['file_chmod_directory'] = 0777;
72+
$settings['file_chmod_file'] = 0666;
6573
```
6674

67-
5. Create local settings
75+
6. Here you can choose to install a standard OS2forms or include the OS2forms Forløb module with necessary configurations.
6876
```sh
69-
cp web/sites/example.settings.local.php web/sites/default/settings.local.php
77+
# Option 1: Standard OS2forms test or development install
78+
fin rebuild-test
79+
```
80+
81+
```sh
82+
# Option 2: OS2forms 2.1 med Forløb test or development install
83+
fin build-forloeb
7084
```
7185

72-
6. Configure trusted hosts in settings.local.php (add the following if not present)
86+
7. Configure trusted hosts in settings.local.php (add the following if not present)
7387
```php
7488
// web/sites/default/settings.local.php
7589

@@ -87,16 +101,18 @@ For a more detailed description, you could look at the `web/core/INSTALL.txt` [h
87101

88102
* A HTTP server such as [Apache](https://httpd.apache.org/) that supports PHP
89103
* A database service such as [MySQL](https://www.mysql.com/)
90-
* PHP 7 with the following extensions enabled:
104+
* PHP 7.4 with the following extensions enabled:
91105
* gd
92106
* curl
93107
* simplexml
94108
* xml
95109
* dom
96110
* soap
97111
* mbstring
112+
* zip
98113
* database specific extension such as the mysql extension
99114
* [Composer](https://getcomposer.org/)
115+
* [Drush launcher](https://github.com/drush-ops/drush-launcher)
100116

101117
### Installing
102118

@@ -115,7 +131,26 @@ cd os2forms8
115131
composer install --no-dev
116132
```
117133

118-
4. Generate a salt string and insert it in web/sites/default/settings.php
134+
4. Create local settings
135+
```sh
136+
cp web/sites/default.settings.local.php web/sites/default/settings.local.php
137+
```
138+
5. Add databases settings to web/sites/default/settings.local.php
139+
140+
```
141+
$databases['default']['default'] = array (
142+
'database' => '[dbname]',
143+
'username' => '[dbuser]',
144+
'password' => '[dbpass]',
145+
'prefix' => '',
146+
'host' => '[dbhost]',
147+
'port' => '',
148+
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
149+
'driver' => 'mysql',
150+
);
151+
```
152+
153+
6. Generate a salt string and insert it in web/sites/default/settings.local.php
119154
```sh
120155
# Generate salt string - this will output a new salt string
121156
./vendor/bin/drush php-eval 'echo \Drupal\Component\Utility\Crypt::randomBytesBase64(55) . "\n";'
@@ -126,18 +161,29 @@ composer install --no-dev
126161
$settings['hash_salt'] = ''; // Insert the generated salt string here
127162
```
128163

129-
5. Configure trusted hosts in web/sites/default/settings.php.
164+
7. Configure trusted hosts in web/sites/default/settings.local.php.
130165
For more information on how to write this, see the section for [Trusted Host settings](https://www.drupal.org/docs/installing-drupal/trusted-host-settings)
131166
in the official Drupal installation guide.
132167
```php
133-
// web/sites/default/settings.php
168+
// web/sites/default/settings.local.php
134169

135170
$settings['trusted_host_patterns'] = [''];
136171
```
137-
6. Visit the url for the os2forms application and follow the instructions
172+
8. Install Drupal
173+
174+
Using drush command:
175+
```
176+
# To install default OS2Forms
177+
drush si os2forms8 --account-pass=account_password --site-name="OS2Forms"
178+
179+
# To install OS2Forms 2
180+
drush si os2forms_forloeb_profile --account-pass=account_password --site-name="OS2Forms med forløb"
181+
```
182+
183+
Or visit the url for the os2forms application and follow the instructions
138184
* Select the os2forms install profile for a default os2forms installation
139185

140-
7. Enable OS2Forms modules
186+
9. Enable OS2Forms modules
141187
```sh
142188
./vendor/bin/drush en os2forms, os2forms_nemid, os2forms_dawa, os2forms_sbsys
143189
```

composer.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"composer/installers": "^1.2",
2121
"cweagans/composer-patches": "^1.6.5",
2222
"drupal/bootstrap": "^3.21",
23+
"drupal/config_entity_revisions": "1.7.0",
2324
"drupal/console": "^1.0.2",
2425
"drupal/core": "^8.7.1",
2526
"drupal/core-composer-scaffold": "^8.9",
@@ -29,6 +30,7 @@
2930
"drupal/ldap": "^3.0@beta",
3031
"drupal/migrate_tools": "^5.0",
3132
"drupal/migrate_upgrade": "^3.2",
33+
"drupal/permissions_by_term": "2.25",
3234
"drupal/queue_mail": "^1.3",
3335
"drupal/queue_ui": "^2.1",
3436
"drupal/restui": "^1.20",
@@ -37,14 +39,15 @@
3739
"drupal/telephone_validation": "^2.2",
3840
"drupal/webform_analysis": "^1.0@beta",
3941
"drupal/webform_composite": "^1.0@RC",
40-
"drupal/webform_migrate": "1.x-dev",
42+
"drupal/webform_migrate": "^1.2",
4143
"drupal/webform_node_element": "^1.1",
4244
"drupal/webform_scheduled_tasks": "^2.0",
4345
"drupal/webform_views": "^5.0@alpha",
4446
"drush/drush": "^9.0.0",
4547
"os2core/os2core": "^1.0.3",
4648
"os2forms/os2forms": "^2.5",
4749
"os2forms/os2forms_egbolig": "dev-master",
50+
"os2forms/os2forms_forloeb": "1.1.0",
4851
"os2web/os2web_logging": "dev-master",
4952
"vlucas/phpdotenv": "^2.4",
5053
"webflo/drupal-finder": "^1.0.0",
@@ -108,17 +111,17 @@
108111
"force-reset": true
109112
},
110113
"patches": {
111-
"drupal/webform" : {
112-
"Add support for Set to state" : "./patches/add-set-to-state-3159806-2-modified-5.19.patch"
114+
"drupal/webform": {
115+
"Add support for Set to state": "./patches/add-set-to-state-3159806-2-modified-5.19.patch"
113116
},
114-
"drupal/webform_migrate" : {
115-
"Set to support. Checkbox condition fixes" : "./patches/setto-and-checkboxes-condition-fix-onlyD7.patch"
117+
"drupal/webform_migrate": {
118+
"Set to support. Checkbox condition fixes": "./patches/setto-and-checkboxes-condition-fix-onlyD7.patch"
116119
},
117-
"drupal/queue_mail" : {
118-
"Admin interface to see queued mail" : "https://www.drupal.org/files/issues/2020-06-30/3096917-ui-queue-mail-moderate-5.patch"
120+
"drupal/queue_mail": {
121+
"Admin interface to see queued mail": "https://www.drupal.org/files/issues/2020-06-30/3096917-ui-queue-mail-moderate-5.patch"
119122
},
120-
"drupal/smtp" : {
121-
"Duplicated Attachments using webforms" : "https://www.drupal.org/files/issues/2020-06-18/smtp-2995290-17.patch"
123+
"drupal/smtp": {
124+
"Duplicated Attachments using webforms": "https://www.drupal.org/files/issues/2020-06-18/smtp-2995290-17.patch"
122125
}
123126
}
124127
}

0 commit comments

Comments
 (0)