Skip to content

Commit 368f08c

Browse files
committedOct 23, 2020
Restructured documents and tried to remove duplicated entries about git and drush
- Git can drush command live in separate documents to reduce duplication. - Removed all mention about Norstore, we now longer have that infrastructure. - Tried to give the documentation better structure and easier to read as a single document instead of badly connected stand alone documents with with duplicated and outdated paragraphs.
1 parent c7432a9 commit 368f08c

File tree

7 files changed

+98
-81
lines changed

7 files changed

+98
-81
lines changed
 

‎doc/contrib.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
# Contribute changes and improvements
2-
Before starting make sure you [reset your local installation](reset.md).
1+
# Make changes to ELMCIP
32

4-
## Make changes to existing configuration
5-
You are now ready to make changes your local installation. Peform your changes through Drupal UI for views, fields and other changes.
3+
Before starting make sure you first [reset your local installation](reset.md) your local installation.
64

7-
## Work with the features module from drush
8-
These changes will cause the feature module to get overridden. Run `bin/site-drush fl` to confirm this. Export the changes from the database to the file system 'bin/site-drush fu <feature name>'.
5+
## Make a change to the existing site
96

10-
For more information, read our [features module document](features.md). You should now have moved the changes you did to the Drupal database and to the file system.
7+
Make the wanted changes through the Drupal UI, example a view, alter fields help texts and so on. The changes are stored in your database and you need to export them by using the Features module.
118

12-
## work with git
9+
These changes will cause the feature module to get overridden. Confirm your changes by running.
1310

14-
git checkout -b issue_number
15-
This create your own branch out from the master branch that you can safely work on. Do your changes and add them to git. check out [our brief git section](../README.md).
11+
bin/site-drush fl
12+
13+
Export the changes from the database to the file system
1614

17-
These changes need to pushed to github before test.elmcip.net or other developers can test them.
15+
bin/site-drush fu <feature name>
1816

19-
If the issue then is confirmed working and can be safely applied to production will the code make it into the master branch. Snapshots of the master branch is what in the end makes the production branch.
17+
For more information about how to use the Features module, read our [Features document](features.md).
2018

19+
You now have exported your changes to the file system and these need to added with Git and pushed upstream allowing test.elmcip.net or other developers to test the changes. To learn more about how to work with git read the [git documentation](git.md).

‎doc/features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The [Features](https://www.drupal.org/project/features) module allow us to export and import configuration that else would be locked in the database together with the content like nodes, taxonomy terms and so on.
44

5-
The easiest way of interacting with is by using the command line toool [Drush](https://www.drush.org). There is a UI for it inside Drupal, feel free to explore it (`/admin/structure/features`), it will not be documented here.
5+
The easiest way of interacting with is by using the command line tool [Drush](https://www.drush.org). There is a UI for it inside Drupal, feel free to explore it (`/admin/structure/features`), it will not be documented here. An excellent starting point to learn more about Features is the official [module documentation](https://www.drupal.org/node/580026).
66

77
## List all feature modules and their current state.
88

‎doc/git.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# how to use Git
2-
This document does not try to cover all you need to know about [Git](https://git-scm.com) and version control systems (VCS) but should get you started working with git.
1+
# How to use Git
2+
3+
This document does not cover all you need to know about [Git](https://git-scm.com) and version control systems (VCS) in general but it should be enought to get you started. To learn more buy a book or read online resources like [Pro Git](https://git-scm.com/book) and [Git Immersion](https://gitimmersion.com).
34

45
## Best practise in a git workflow
56

@@ -21,7 +22,7 @@ See differences between the orginal state and your installation.
2122

2223
git diff
2324

24-
If you whant to see the changes in a single file use `git diff <filename>`
25+
If you want to see the changes in a single file use `git diff <filename>`
2526

2627
Add files to be comitted (staging).
2728

@@ -39,3 +40,13 @@ Push your changes to github
3940

4041
git push
4142

43+
44+
## Getting rid of unattended local changes
45+
46+
If your system is not clean.
47+
48+
git reset --hard`
49+
50+
Remove all local changes to files. Make sure you use this with care and you fully understand what you do. This do not remove files that are unknown (untracked) to Git.
51+
52+
Run `git status` again to verify that your system are now really is clean.

‎doc/install.md

+40-17
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
1-
# ELMCIP Installation
1+
# Install ELMCIP
22

3-
## Requirements
3+
This is something you only have to do on a new machine or perhaps you want to have multiple local instances of ELMCIP running.
44

5-
* A working installation of Apache or another web server, MySQL/MariaDB and PHP 7.0 or newer.
6-
* A empty database named `elmcip`.
7-
* Database user name `elmcip` with full access to the elmcip database.
8-
* Set password for user elmcip to `elmcip`.
9-
* Git installed and configured.
10-
* Drush installed (https://github.com/drush-ops/drush).
11-
* A working ssh connection to Norstore application and database server. Auth should not be password based but by using your private/public SHA -key.
12-
* You must be in your local elmcip directory.
5+
## Software requirements
6+
7+
* Webserver/service like [Apache](https://httpd.apache.org) or another web server.
8+
* MySQL or equivalent like MariaDB.
9+
* PHP 7.2.x or newer.
10+
* [Git](https://git-scm.com) installed. Verify by running `git --version`
11+
* [Composer](https://getcomposer.org) installed. Verify by running `composer --version`
12+
13+
## Required configurations
14+
15+
1. Create a empty Mysql database. `elmcip` is a natural name to choice with a database user name with full access to the elmcip database. In test env. we normally also name this `elmcip`.
16+
1. Make a directory where your ELMCIP installation can be installed and make your webserver `DocumentRoot` `<directory you just created>/elmcip/drupal`.
1317

1418
## Installation
1519

16-
Get main repository and any custom modules. Run this in your web server document root.
20+
1. To get the ELMCIP, Drupal core and all third party and custom modules you need to clone the `elmcip` repository.
1721

18-
git clone git@github.com:elmcip/elmcip.git
19-
cd elmcip
22+
git clone git@github.com:elmcip/elmcip.git elmcip
2023

21-
Get drupal core and all 3-part modules:
24+
Your webserver DocumentRoot is elmcip/drupal. Make sure your default or vhost point to this directory.
25+
26+
1. The elmcip use git modules and to get Drupal you need to update the submodules.
2227

2328
git submodule update --init
2429

25-
Initialize the new site:
30+
1. Initialize the new site:
31+
32+
bin/site-init
33+
34+
You should now have a functional copy of ELMCIP with everything except for images videos. If you locally need them is there a module named 'Stage File Proxy' that can pull on demand images directly from production.
35+
36+
## Troubleshooting
37+
38+
### Problems importing database
39+
If you are unable to restore (import) the database your database server resource might be too low. Try upping this by adding `max_allowed_packet = 100M` to your database configuration. Often called my.cnf or server.cnf and then restart the database service.
40+
41+
### Problem loading large Drupal pages
42+
43+
Example if you load pages like '/admin/people/permissions' and your are unable to change and save configuration. Please check your apache or php-error log. You might then see warnings like:
44+
45+
PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: http://elmcip.local/admin/people/permissions
46+
47+
To fix this you need to change the site php.ini. Not sure where your php.ini files are run `php --ini` in the command line. Search for this line with `max_input_vars` and change it to something like this. Make sure you also uncomment the line.
2648

27-
bin/site-init <norstore username>
49+
; How many GET/POST/COOKIE input variables may be accepted
50+
max_input_vars = 1500
2851

29-
You should now have a fully functional site, with all content, except files and images. [Reset and upgrade local installation](reset.md) explain how to get images and media to your local site if needed.
52+
Save and restart your PHP service.

‎doc/offline.md

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# ELMCIP Offline mode
1+
# ELMCIP offline mode
22

3-
This does attempt to do any network connections.
3+
Allow you to work locally without any network connections, aka flight mode.
44

5-
* Enable you to work while traveling.
6-
* Speeds up working with ELMCIP.
7-
* Allow you to reset while traveling.
5+
* Work while traveling.
6+
* Speeds up your local work flow without needing to create new database copies.
87

9-
## What does this mean
8+
## What does all this mean
109

1110
Any changes to the development branch (master) will never pulled from github. No attempt to sync with Norstore getting files and databse. Are your local copy more and less up to date is this not a big problem.
1211

@@ -16,33 +15,31 @@ Any changes to the development branch (master) will never pulled from github. No
1615

1716
### Getting clean
1817

19-
Make sure you don't have any local changes applied to your file system before continuing. GIT will tell you if you have.
18+
Make sure you don't have any local changes applied to your file system before continuing. Git will tell you if you so have.
2019

2120
git status
22-
23-
If your system is clean, run: `git reset --hard`. This remove any local changes to files. Note this will not remove files GIT do not know. Rerun `git status` to verify that your system are really clean. Want to learn more about GIt, try reading [Pro Git](http://progit.org) or any git book available.
21+
22+
For more read our [Git documentation](git.md)
2423

2524
### Reset
2625

2726
This reset you back to production and grabbing the latest local database copy.
2827

2928
bin/offline_reset2production
3029
31-
## Going to Ludicrous Speed
30+
## Optimising your local work flow
3231

33-
This remove all cache tables, search index and other from system, greatly reducing time spent restoring database and working with in general.
32+
Written to speed up your local workflow though as usual you need to know what your are doing and is normally only used by more experienced users. This utility removes all database caching tables not needed. This greatly reduces the size and time spent restoring the database.
3433

3534
bin/make-fast
3635

37-
Changes are made to the running database but also leave a uncompressed copy of the optimized databse in the `site` directory.
36+
It perform these changes your running database but also create a uncompressed copy of the optimized database in `site/latest.elmcip.sql`.
3837

39-
### Using optimized database copy
38+
To use this datbase copy run `offline_reset2production` with the `fast` option.
4039

4140
bin/offline_reset2production fast
4241

43-
### How fast is fast
44-
45-
Benchmarks done when your local site is warm, aka there was no new files to sync. Meaning the online sync might be slower for your system.
42+
### How fast is make-fast
4643

4744
* online reset (bin/reset2production): 7m
4845
* Offline (bin/offline_reset2production): 6m 48sec

‎doc/reset.md

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
1-
# Reset local installation to production
2-
It will take a while the very first time you run it. You minimum need a copy of the database. Syncing media files with production is optional and not really needed to work with your local copy. There is also a offline mode allowing you to work even with no network connection. Read about [working offline](offline.md), note that running offline mode also have a time saver option restoring the database.
3-
4-
bin/reset2production <norestore username> <all | none>
5-
6-
`reset2production` takes two optional parameters. Omit these to use your local username and skip large files during sync.
1+
# Reset a local installation to production state
72

8-
1. Your norstore username.
9-
2. Sync modes: `all` sync all files and takes a long time to run. `none` transfare no files, only the needed database.
3+
It will take a while the very first time you run it. You minimum need a copy of the database. Syncing media files with production is optional and not really needed to work with your local copy. There is also a offline mode allowing you to work even with no network connection. Read about [working offline](offline.md), note that running offline mode also have a time saver option restoring the database.
104

11-
Typical use is:
5+
bin/reset2production
126

13-
bin/reset2production username none
7+
## Make sure your local installation is clean
148

15-
## Get clean
169
Make sure you don't have any local changes applied to your file system before continuing. GIT will tell you if you have.
1710

1811
git status
1912

2013
If your system is not clean, run: `git reset --hard`. This remove any local changes to files. Note this will not remove files unknown to GIT. Rerun `git status` to verify that your system are really clean. Want to learn more about GIT, try reading [Pro Git](http://progit.org) or any git book available.
2114

22-
## Grab a copy of production (elmcip.net)
15+
## Get a copy of the production database
2316
This will automagically update your local installation. It grabs copy of the database and any if wanted newly added files added since last time you did this.
2417

25-
bin/reset2production <norestore username>
18+
bin/reset2production
2619

2720
You are now identical to the production site.
2821

29-
### Problem syncing with production
30-
31-
* Might could be caused by your network connection. Norstore firewalls only open up certain IP addressed. UiB IP-range is one of the allowed ranges that can do ssh into elmcip1 and elmcip2. By using a VPN connection to UiB will your machine use the allowed IP-range. This also work if you are traveling and hacking out from your favorite cafe.
32-
* If your local username and your norstore are not identical make sure you are running `bin/reset2production <norestore username>`.
33-
* Tired of typing passwords? Adding your ssh public key to your norstore home area remove this need.
3422

3523
## Upgrade from production to development (master)
3624

‎doc/test_verify.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Test and verify an issue
2-
Before continuing [reset](reset.md) your local installation.
1+
# How to locally test and verify a issue
2+
3+
Before continuing make sure your have read and performed a [reset](reset.md) of your local installation.
34

45
## Test a issue
6+
57
This grab an existing issue and try upgrade and deploy the changes to your local installation. The general rule is that we use the issue number created by github. In this example we will test issue 666.
68

79
#### Upgrade your site to test issue 666
@@ -11,29 +13,26 @@ This grab an existing issue and try upgrade and deploy the changes to your local
1113
Make sure your site turned up clean after the upgrade. If not, the issue is not OK and you should stop testing. It should look something like this:
1214

1315
Name Feature Status Version State
14-
Date Migration Example date_migrate_example Disabled 7.x-2.8
15-
Development settings development_settings Enabled
1616
ELMCIP content types elmcip_content_types Enabled
1717
ELMCIP Views elmcip_data_export Enabled
1818
ELMCIP field instances elmcip_field_instances Enabled
1919
ELMCIP layout elmcip_layout Enabled
2020
ELMCIP permissions elmcip_permissions Enabled
21-
Setup ELMCIP elmcip_setup Enabled
22-
Features Tests features_test Disabled 7.x-2.3
23-
Schema.org example: Event schemaorg_event Disabled 7.x-1.0-beta4
24-
Schema.org example: Person schemaorg_person Disabled 7.x-1.0-beta4
25-
Schema.org example: Recipe schemaorg_recipe Disabled 7.x-1.0-beta4
26-
UUID Services Example uuid_services_example Disabled 7.x-1.0-alpha6
21+
ELMCIP tests elmcip_setup Enabled
22+
...
2723

2824
#### Login as user 1 without password
2925

30-
bin/site-drush uli -l elmcip.dev
26+
bin/site-drush uli
3127

3228
#### Enable all our development settings
3329

34-
bin/site-drush en development_settings
30+
bin/site-drush en --yes development_settings
3531

3632
Test the issue and if it is OK, change the status of it to `verified by community`.
3733

38-
#### To chain commands for testing
39-
bin/reset2production USERNAME; bin/site-upgrade issue_INSERT ISSUE NUMBER; bin/site-drush en -y development_settings ; bin/site-drush uli
34+
#### Chain commands for quicker testing
35+
36+
Depending on the speed of your computer this might allow you to refill your cup of your favorite brew while it run.
37+
38+
bin/offline_reset2production; bin/site-upgrade <issue_number>; bin/site-drush en --yes development_settings; bin/site-drush uli

0 commit comments

Comments
 (0)
Please sign in to comment.