Skip to content

Commit

Permalink
Ready to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Feb 26, 2014
1 parent 9c0b348 commit eeee90f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 30 deletions.
9 changes: 0 additions & 9 deletions Module.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<?php
/**
*
* PHP version 5
*
* Created by PhpStorm.
* User: Георгий
* Date: 24.02.14
* Time: 12:42
*/

namespace sitkoru\updater;

Expand Down
48 changes: 46 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@
update
Usage:
===========

Console app for update CG2/Yamobi2
Add
```js
"sitkoru/updater": "dev-master"
```
to require section of your composer.json

Enable module in console app config:
```php
'modules'=>[
...
'updater' => [
'class' => \sitkoru\updater\Module::className(), //module class name
'path' => dirname(dirname(__DIR__)), //path to app
'versionFilePath' => 'version.php', //path to file to store version
'currentVersion' => defined('CG_VERSION') ? CG_VERSION : 0.0, //current version. If empty, updater will try to get it from versionFile
'versionConstant' => 'CG_VERSION', //constant name to store version
'releasePrefix' => "origin/release-", //prefix to identify release branches in git
'assetsCommands' => [ //commands for publish assets
"./yii asset/compress app/config/main.assets.php app/config/bundles.php" //for example
],
'customCommands' => [ //commands for custom operations, like starting daemons or something else
"nodejs bin/chat.js" //for example
]
],
...
]
```

Other options you can see in Module.php

Run
```bash
./yii updater/release
```
and follow instructions =)

Notice:
===========
Updater override yii's migrate functions to mark migrations with app version. Some advices:

1. Don't use it in dev mode =)

2. Don't use ./yii migrate on production

3. If you need to manually apply migrations, use ./yii updater/migrations/up 0 1.1 //replace 1.1 with real version
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Updater for Sitko.ru Yii2 projects",
"keywords": ["sitkoru", "cg2", "yii2"],
"type": "yii2-extension",
"license": "closed",
"license": "MIT",
"support": {

},
Expand Down
9 changes: 0 additions & 9 deletions controllers/MigrationsController.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<?php
/**
*
* PHP version 5
*
* Created by PhpStorm.
* User: Георгий
* Date: 26.02.14
* Time: 10:48
*/

namespace sitkoru\updater\controllers;

Expand Down
9 changes: 0 additions & 9 deletions controllers/ReleaseController.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<?php
/**
*
* PHP version 5
*
* Created by PhpStorm.
* User: Георгий
* Date: 21.02.14
* Time: 14:11
*/

namespace sitkoru\updater\controllers;

Expand Down

0 comments on commit eeee90f

Please sign in to comment.