Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cboulanger committed Aug 1, 2021
1 parent 3544ca8 commit 3bafe35
Show file tree
Hide file tree
Showing 28 changed files with 157 additions and 17,791 deletions.
9 changes: 5 additions & 4 deletions doc/dev/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ where options are:
--skip-composer - skip building of the composer dependencies
--deploy-host, -H path - the host server to deploy to via SSH, overrides
DEPLOY_HOST
--deploy-dir, -D path - the directory on the host to deploy to,
overrides DEPLOY_DIR
--deploy-php, -P version - the PHP version used on the host server, overrides
PHP_VERSION
--deploy-dir, -D path - the directory on the host to deploy to, overrides
DEPLOY_DIR
--deploy-config-dir, -C path - the path to the configuration dir, absolute or
relative to the deployment dir. Defaults to
'config', overrides DEPLOY_CONFIG_DIR
Expand Down Expand Up @@ -81,8 +83,7 @@ by `--env-file`, or c) to be set with `--set-env`:
DB_PASSWORD - Password of that user
DB_ROOT_USER - The name of the root user, usually "root"
DB_ROOT_PASSWORD - Password of root user (necessary only if DEPLOY_DB_CREATE_USER=1)
COMPOSER - path to composer.json, if different from the one in the source (this might
be necessary if the target server has a legacy PHP version)
COMPOSER - path to composer.json, if different from the ones in the sources
```

## Deployment scenarios
Expand Down
53 changes: 37 additions & 16 deletions doc/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on GitHub, check it out locally and start hacking away...

## Setup development environment

### Prerequisites

In order to be able to develop Bibliograph with the same
tools regardless of the development environment, a dockerized
setup is used. You need the following prerequisites:
Expand All @@ -18,20 +20,38 @@ setup is used. You need the following prerequisites:

- [PNPM](https://github.com/pnpm/pnpm): Install with `npm
install -g pnpm` - you can also use NPM, if you prefer.

First, run `pnpm install` to install all needed NPM modules.
Then, run `pnpm run install` to set up the docker containers
with the development environment. This will provide you with the
following dockerized services running in separate containers:

- PHPFarm with php versions 7.0 - 7.4 via Apache on localhost:8070-8074 (8.x will be added shortly)

### Install frontend and backend development environment

First, run `pnpm install` to install all needed NPM modules.

The backend consists of the following dockerized
services running in separate containers:

- PHPFarm with php versions 7.2 - 8.0 via Apache on localhost:8072-8080
- MariaDB on localhost:3036

Since the backend is dockerized, you need to use wrapper scripts to
call the underlying basic executables, such as `php`, `composer`,
If you don't need to support the whole range of PHP versions listed above,
override the `PHP_TEST_VERSIONS` environment variable defined in `test/.env` by
redefining it in a new file `test/.env.local`. This will speed up installation
and testing considerably. In the same file, you can set the version of PHP
you primarily want to work with in the `PHP_VERSION` environment variable.

Installing the composer dependencies is much faster if you
configure Composer with a GitHub Personal Access Token. Go to
https://github.com/settings/tokens and generate a new token.
Then execute
```bash
tool/bin/composer config -g github-oauth.github.com <PAT>
```

Then, run `pnpm run install:server` to set up the docker containers with the
backend services. Since the backend is dockerized, you need to use wrapper
scripts to call the underlying basic executables, such as `php`, `composer`,
`codecept`, or `yii`. They can be found in [tool/bin](tool/bin) directory.


### Start the backend services and run the application

To start the services, run `pnpm run services:start`. Afterwards,
you need to run `pnpm run dev:clean` to run the application in
development mode for the first time, setting up the MariaDB server
Expand Down Expand Up @@ -85,13 +105,14 @@ dependabot mechanism), run `pnpm install`.

## Testing code changes

The PHP backend is covered by a fairly extensive test suite which can be run with
`pnpm runn test:codeception:all`. Any changes to the backend should be checked by
running this suite, and any non-trivial addition to it should come with an individual
test for each new feature. You can also run unit, functional and API tests separately
with `pnpm runn test:codeception:(unit|functional|api)`.
The PHP backend is covered by a fairly extensive test suite which
can be run with `pnpm runn test:codeception:all`. Any changes
to the backend should be checked by running this suite, and any
non-trivial addition to it should come with an individual test for
each new feature. You can also run unit, functional and API tests
separately with `pnpm run test:codeception:(unit|functional|api)`.

Frontend tests using [Playwright](https://playwright.dev/) are in preparation.
Frontend tests using [Playwright](https://playwright.dev/) are in preparation.

## Deployment

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"url": "git+ssh://[email protected]/cboulanger/bibliograph.git"
},
"scripts": {
"install": "tool/env/install",
"install:server": "tool/env/install",
"update": "tool/env/update",
"services:start": "tool/env/services-start",
"services:stop": "tool/env/services-stop",
Expand Down
13 changes: 3 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
![Bibliograph Tests](https://github.com/cboulanger/bibliograph/workflows/Bibliograph%20Tests/badge.svg)
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=panyasan&url=https://github.com/cboulanger/bibliograph&title=Bibliograph&language=javascript&tags=github&category=software)

> NOTE: This is v3.0.0-beta, compatible with PHP 7.3, featuring a completely rewritten backend.
Bibliograph is a powerful open source web application for the collaborative
collection, editing and publishing of bibliographic data.

Expand Down Expand Up @@ -78,20 +76,15 @@ project needs your help. Even if you are not a developer, you can contribute:
## Credits
Open source libraries/applications
- [qooxdoo JavaScript framework](http://www.qooxdoo.org): (c) 1&1 Internet AG
- [Yii2 Framework](http://www.yiiframework.com) by Yii Software LLC.
- [CSL - The Citation Style Language](http://www.citationstyles.org).
- [CiteProc-PHP](https://bitbucket.org/rjerome/citeproc-php/) by Ron Jerome
- [CQL/SRU parser](https://github.com/simar0at/sru-cql-parser) by Robert Sanderson and Omar Siam
- [Yii2 Framework](http://www.yiiframework.com) by Yii Software LLC.
- [Codeception](https://codeception.com)

Funding provided by
- [Department of Law, Humboldt-Universität zu Berlin](http://www.rewi.hu-berlin.de)

Bibliograph is developed using
- [Codeception](https://codeception.com) and [PHPUnit](https://phpunit.de) (Testing libraries)
- [Visual Studio Code](https://code.visualstudio.com)
- [Cloud9 IDE](http://c9.io) (Cloud-based coding and testing environment)
- [PHPStorm](https://www.jetbrains.com/phpstorm/) (IDE)
- [GitHub](http://github.com) (Version control and code hosting)
- [BrowserStack](http://browserstack.com) (Browser testing service - sponsored Open Source license)

In particular, the author wishes to thank:
- Gerrit Oldenburg (Humboldt Universität zu Berlin) for finding and fixing various
Expand Down
4 changes: 2 additions & 2 deletions src/lib/composer-7.2/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"ext-pdo": "*",
"ext-simplexml": "*",
"ext-zip": "*",
"georgique/yii2-jsonrpc": "dev-bibliograph",
"hedii/zotero-api": "^1.1",
"magp/yii2-json-schema-validator": "dev-master",
"neitanod/forceutf8": "^2.0",
Expand All @@ -54,7 +53,8 @@
"yiisoft/yii2": "^2.0.32",
"yiisoft/yii2-swiftmailer": "^2.1",
"yosymfony/toml": "^1.0.0",
"ext-mysqli": "*"
"ext-mysqli": "*",
"georgique/yii2-jsonrpc": "dev-bibliograph"
},
"require-dev": {
"bizley/migration": "^2.2",
Expand Down
Loading

0 comments on commit 3bafe35

Please sign in to comment.