Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #173 from silverstripe/v3-ssp
Browse files Browse the repository at this point in the history
Move hosting to SSP
  • Loading branch information
robbieaverill authored Feb 15, 2018
2 parents 9368672 + 2bc4883 commit 047b733
Show file tree
Hide file tree
Showing 18 changed files with 1,141 additions and 404 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
/framework/
/multivaluefield/
/sqlite3/
/queuedjobs/
/crontask/
/silverstripe-cache/
/environmentcheck/
/vendor/
.vagrant
.vagrant*
Expand Down
16 changes: 16 additions & 0 deletions .platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
infrastructure: ^3
php_settings:
version: 7.1
php_settings:
cli:
memory_limit: "1024M"
crons:
queuedjobs_task:
time: '* * * * *'
command: 'test -f /var/www/mysite/www/host.txt && /usr/local/bin/sera 1 php /var/www/mysite/www/framework/cli-script.php dev/tasks/ProcessJobQueueTask 2>&1 | logger -t SilverStripe_cron'
shared_dirs:
mysite:
"addon-downloads": {}
url_rules:
mysite:
'^/addon-downloads/': 'deny'
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: php

php:
- 5.4
- 5.6
- 7.1

before_script:
Expand Down
37 changes: 11 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ from [Packagist](http://packagist.org).
2. `cd` into the directory
3. `composer install`
4. Install elasticsearch `brew install elasticsearch` and configure if required
5. Install redis `brew install redis`
6. Start `elasticsearch` and `redis-server`
7. Start a Resque worker by running `./framework/sake dev/resque/run queue=first_build,update`
8. Run all tasks to populate database (see below, first run may take some time to populate)
5. Start `elasticsearch`
6. Run all tasks to populate database (see below, first run may take some time to populate)

## Dependencies

### Environment variables

* `SS_ADDONS_DOWNLOAD_PATH`: Set this to the full path of the folder to download into. Otherwise, a subfolder of the
SilverStripe temp path will be used.

### ElasticSearch

[ElasticSearch](http://www.elasticsearch.org) is used to provide add-on package indexing and searching.
Expand All @@ -34,38 +37,20 @@ whether the site is on the production server (live) or on UAT or local developme

You should run the elastic search reindex task to create the mappings after installation.

### Redis

Redis is an in-memory data structure store which is used by the Resque module when processing and updating new modules
from Packagist.org.

* Install with `brew install redis`
* Start the redis instance with `redis-server`

Once running you can run the `UpdateAddonsTask` to pull all SilverStripe modules from Packagist into the addons site.

### Resque
### Queued Jobs

A [PHP implementation of resque](https://github.com/chrisboulton/php-resque) is used to provide background building
of add-ons details. As such an installation of [redis](http://redis.io/) must be present. If you wish to use a
remote server, you can configure the `ResqueService` constructor parameters to specify the backend using the
injector in `mysite/_config/injector.yml`.

To run the background tasks you need to spawn worker processes. On a production server this should be set up using a
process monitor such as [god](http://godrb.com/). A new worker process can be spawned using the following command in
the webroot:

```
./framework/sake dev/resque/run queue=first_build,update
```
For extended add-on information such as parsed Readme content, a Queued Job is created during the `UpdateAddonsTask`.
Queued Jobs requires a cronjob to run - for more information [visit the module's wiki](https://github.com/symbiote/silverstripe-queuedjobs/wiki/Installing-and-configuring).

## Tasks

Run each of the following tasks in order the first time you set up the site to ensure you have a full database
of modules to work with.

1. `framework/sake dev/tasks/UpdateSilverStripeVersionsTask`: Updates the available SilverStripe versions.
2. `framework/sake dev/tasks/UpdateAddonsTask`: Runs the add-on updater.
2. `framework/sake dev/tasks/UpdateAddonsTask`: Runs the add-on updater, and queues extended add-on builds.
3. `framework/sake dev/tasks/DeleteRedundantAddonsTask`: Deletes addons which haven't been updated
from packagist in a specified amount of time, which implies they're no longer available there.
4. `framework/sake dev/tasks/BuildAddonsTask`: Manually build addons, downloading screenshots
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@
"composer/composer": "^1.2",
"ezyang/htmlpurifier": "4.5.*@stable",
"silverstripe/framework": "^3",
"symbiote/silverstripe-multivaluefield": "^2",
"symbiote/silverstripe-multivaluefield": "^3",
"silverstripe/toolbar": "^4.0",
"knplabs/packagist-api": "1.*@stable",
"doctrine/inflector": "~1.1.0",
"doctrine/instantiator": "~1.0.0",
"stojg/silverstripe-resque": "*",
"symbiote-library/silverstripe-elastica": "^2",
"symfony/event-dispatcher": "^2.8",
"symfony/filesystem": "^2.8",
"symfony/process": "^2.8",
"symfony/finder": "^2.8",
"symfony/console": "^2.8",
"symfony/yaml": "^2.8",
"guzzlehttp/guzzle": "~3.0",
"symfony/console": "^2.7",
"symfony/debug": "^2.7"
"guzzlehttp/guzzle": "^6",
"symbiote/silverstripe-queuedjobs": ">=3.1.0@dev",
"silverstripe/crontask": "1.x-dev",
"silverstripe/environmentcheck": "^1.3",
"aws/aws-sdk-php": "^3.38"
},
"replace": {
"extensions.silverstripe.org": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpdocumentor/reflection-docblock": "^2",
"phpdocumentor/reflection-docblock": "~3.1.1",
"silverstripe/sqlite3": "*"
},
"minimum-stability": "dev",
Expand Down
Loading

0 comments on commit 047b733

Please sign in to comment.