Skip to content

Commit

Permalink
Bug SAFeSEA#34, New streamline prepare and build composer scripts…
Browse files Browse the repository at this point in the history
… [iet:10301360]

* Allows me to simplify README documentation, `travis` YAML
  • Loading branch information
nfreear committed Feb 6, 2018
1 parent 2ab1c9a commit 0cb1d0d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 32 deletions.
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,16 @@ before_install:
- npm -v

install:
- composer prepare
- composer install
- npm install
- composer npm-install

before_script:
- composer copy-dotenv
- composer copy-conf
- composer mkdir
before_script: composer build
#- composer chown # chown: invalid user: ‘nginx:nginx’
- composer symlink-data
- npm run symlink-js
- npm run build
- npm run min
- npm run hash-js

script: composer test

after_script:
- composer version.json
- composer validate
- ls -alh
- ls -alh public_html/assets/
Expand Down
19 changes: 10 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## [Version 3.0.0](https://github.com/IET-OU/openEssayist-slim/releases/tag/3.0.0-beta)

* Date: ~6 February 2018 _(Development: 10 Jan - 6 Feb.)_
* Tag: _3.0.0-beta_ (Describe: `v2.6-104-g9c0b3c5`)
* Tag: _3.0.0-beta_ (Describe: `v2.6-108-g2ab1c9a`)
* Notes: [Google Docs][]
* Built on: PHP 7.0 / Slim framework v 2.2.0 / MySQL

Expand All @@ -28,35 +28,35 @@ Below are the __headline__ items. More details are in [Google Docs][].

### User-interface

* Added configurable `maxlength` character limit to the draft-essay submission form - prevent analyser errors; server-load (Bug #30)
* Made error messages to user more user-friendly - for example, prefixed them with "_Sorry. ..._".
* Added configurable `maxlength` character limit to the draft-essay submission form prevent analyser errors; server-load (Bug #30)
* Made error messages to user more user-friendly for example, prefixed them with "_Sorry. ..._".

### Database

* Database schema fixes and edits - add dates/times, reduce column lengths (Bug #25)
* Add analysis start/end time columns (Bug #25)
* Prevent Web application from automatically creating database, tables, seeding test/example data (Bug #24)
* New `app/cli.php` to create tables, seed with minimal/ configurable user, group and task data,
* Configuration/ connection fixes to ensure data is sent/stored as `UTF-8` in database (Bug #26)
* Configuration/ connection fixes to ensure data is sent/stored as `UTF-8` in database (Bug #26).

### Javascript

* Javascript moved from `base.html.twig` and `site.twig` templates to separate JS files (maintainability, performance),
* Javascript moved from some `drafts/view.*.twig` templates to separate JS files,
* Added `semistandard` linting to [Travis-CI][] for 'openessayist' Javascripts [QA]
* Third-party Javascript/CSS versions documented in `package.json`,
* Added `semistandard` linting to [Travis-CI][] for 'openessayist' Javascripts — lots of fixes [QA]
* Third-party Javascript/CSS versions documented in [`package.json`][pkg],
* Transferred more key 3rd-party Javascript libraries to CDN (performance),
* Centralised versioning of 3rd-party Javascript - via `VersionedAsset` PHP class (Bug #33)
* Centralised versioning of 3rd-party Javascript via `VersionedAsset` PHP class (Bug #33)
* Upgraded jQuery from 1.9.1 to 2.2.4 _(can't upgrade to 3.x - Bootstrap bug?)_
* Added Google Analytics,
* Added Google Analytics.

### Miscellaneous

* Add missing Open University copyright statements — in PHP, Javascript, user-interface, `composer.json` (Bug #20)
* Added _Nicolas Van Labeke_ (`vanch3d`) to `composer.json`
* Removed legacy `composer.phar` binary from Git; removed `./openessayist.sql.zip` (2.6 MB)
* Moved unused Javascript from Twig templates to separate JS file(s),
* Added test data — sourced from [Project Gutenberg][pg] and [ORO][]
* Added test data — sourced from [Project Gutenberg][pg] and [ORO][].


---
Expand Down Expand Up @@ -92,6 +92,7 @@ Below are the __headline__ items. More details are in [Google Docs][].

[releases]: https://github.com/IET-OU/openEssayist-slim/releases
[readme]: https://github.com/IET-OU/openEssayist-slim#readme
[pkg]: https://github.com/IET-OU/openEssayist-slim/blob/3.x/package.json#L12-L38 "package.json"
[travis-ci]: https://travis-ci.org/IET-OU/openEssayist-slim "Travis-CI continuous integration"
[Google Docs]: https://docs.google.com/document/d/1n6T2zJ1FMifHGEniYyU_V2d0F8WOHWb_JPRqEWCyR2Y/# "Release notes"
[vanch3d]: https://github.com/vanch3d "Original developer: Nicolas Van Labeke (vanch3d)"
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ composer redhat-install # yum install php php-fpm php-mcrypt php-zip httpd mod
## Install .. Test

```sh
composer copy-dotenv # OU only (edit: '.env')

composer prepare # Edit: 'app/config.php'
# OU only - edit: '.env'
composer install
composer copy-conf # Edit: 'app/config.php'
composer copy-nginx # Only on Redhat
composer mkdir
composer npm-install
composer copy-nginx # Only on Redhat 7.
composer chown # Only on Redhat 7.
composer version.json

npm run symlink-js
composer build
composer test
```

Expand Down
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
],
"prefer-stable": true,
"minimum-stability": "dev",
"autoload": {
"X-classmap": [ "app/" ]
},
"autoload": { },
"repositories": [
{ "type": "composer", "url": "https://embed.open.ac.uk/iet-satis/" }
],
Expand Down Expand Up @@ -47,8 +45,15 @@
},
"scripts": {
"cli-help": "app/cli.php --help",
"redhat-install": "yum install php php-mcrypt php-zip patch httpd mod_fcgid # -y",
"redhat-install": "yum install php php-mcrypt php-zip patch httpd mod_fcgid # No -y",
"redhat-check": "yum install php* 2>/dev/null | grep 'already installed'",
"npm-install": "npm i",
"prepare": [
"composer copy-dotenv", "composer copy-conf", "composer mkdir", "composer symlink-data", "npm run symlink-js"
],
"build": [
"npm run build", "npm run min", "npm run hash-js", "composer version,json"
],
"mkdir": [ "mkdir ./.cache", "mkdir ./.logs", "mkdir -p _user_data/images" ],
"chown": [ "chown -R nginx:nginx ./.cache", "chown -R nginx:nginx ./.logs" ],
"symlink-data": [ "cd public_html; ln -s ../_user_data/images user-images" ],
Expand All @@ -59,7 +64,6 @@
"_X_pip-install": "pip install git+https://github.com/google/mysql-tools.git@02d1854273#egg=mysql-tools",
"_X_install-mysql-lint": "git clone --depth=4 https://github.com/google/mysql-tools",
"mysql-lint": "PYTHONPATH=$PYTHONPATH:$(pwd)/mysql-tools/parser_lib; python mysql-tools/validate.py FILE.sql",
"npm-install": "npm i db-linter # Markdown generator.",
"version.json": [
"(printf '{ \"v\": \"'; printf `git describe --long --dirty --always`; printf '\", \"t\": \"'; date | tr -d '\n'; printf '\" }') > public_html/version.json # date -Is"
],
Expand Down

0 comments on commit 0cb1d0d

Please sign in to comment.