rocketeers / rocketeer

Send your projects up in the clouds
http://rocketeer.autopergamene.eu/
MIT License
2.66k stars 217 forks source link

Shared SQLite db #223

Closed terion-name closed 10 years ago

terion-name commented 10 years ago

I can't figure out how to properly share sqlite db.

hooks.php:

'before' => array(
        'setup' => array('touch app/database/production.sqlite'), // to create a file if deployed first time
    ),

remote.php:

'shared' => array(
        '{path.database}production.sqlite',
        '{path.storage}/logs',
        '{path.storage}/sessions',
    ),
    'permissions' => array(
        'files' => array(
            '{path.database}production.sqlite',
            '{path.storage}',
            '{path.public}',
        ),

And in output:

(staging) Compiling common classes
Setting permissions for ~/.../staging/releases/20140523170939/production.sqlite
(staging) chmod: cannot access `/.../staging/releases/20140523170939/production.sqlite': No such file or directory
Setting permissions for ~/.../staging/releases/20140523170939/app/storage
Setting permissions for ~/.../staging/releases/20140523170939/public
(staging) mv: cannot stat `/.../staging/releases/20140523170939/production.sqlite': No such file or directory
Sharing file ~/.../staging/releases/20140523170939/production.sqlite
Sharing file ~/.../staging/releases/20140523170939/app/storage/logs
Anahkiasen commented 10 years ago

I'm not sure path.database is actually a thing, or did you define that in your app's paths.php ?

terion-name commented 10 years ago

Oh, sorry, pasted not from latest version.

with this:

'shared' => array(
        'app/database/production.sqlite',
        '{path.storage}/logs',
        '{path.storage}/sessions',
    ),
    'permissions' => array(
        'files' => array(
            'app/database/production.sqlite',
            '{path.storage}',
            '{path.public}',
        ),

result is the same:

Setting permissions for ~/.../staging/releases/20140523172143/app/database/production.sqlite
[territory@77.120.105.131] (staging) chmod: cannot access `/.../staging/releases/20140523172143/app/database/production.sqlite': No such file or directory
Anahkiasen commented 10 years ago

wut tuh hell. Hm, you have multiple stages I'm assuming correct ?

terion-name commented 10 years ago

yeap

Anahkiasen commented 10 years ago

Hm maybe permissions are set before symlinks are created, and thus there may actually be nothing there when it tries to chmod ?

terion-name commented 10 years ago

but there is a hook:

hooks.php:
'before' => array(
        'setup' => array('touch app/database/production.sqlite'), // to create a file if deployed first time
    ),

or this command should be placed in other flow point?

Anahkiasen commented 10 years ago

setup is only called when you deploy really for the first time, not every time you deploy, or is this actually the case here ?

terion-name commented 10 years ago

No, it's not the case.. It would be better to touch db at every deploy. Ok, I've tried to:

'before' => array(
        'deploy' => array('touch app/database/production.sqlite'),
    ),

But the same — no file, it is not shared

terion-name commented 10 years ago

Also tried:

Rocketeer::listenTo('deploy.before-symlink', [function ($task) {
    $task->runForCurrentRelease('touch app/database/production.sqlite');

no luck

terion-name commented 10 years ago

@Anahkiasen Anything about this?

Anahkiasen commented 10 years ago

Can you var dump $task->runForCurrentRelease('ls app/database -al') see if it's not going into the wrong folder ?

Anahkiasen commented 10 years ago

@terion-name Any news on this ?

Anahkiasen commented 10 years ago

Will reopen if this is still happening on develop but it should be fixed

eruecco87-zz commented 10 years ago

Hi, not sure but I think I'm having the same issue and dont know how to fix it.

Setting permissions for public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/app/database/production.sqlite
[conteo@www.conteoregresivo.com] (staging) chmod: cannot access `public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/app/database/production.sqlite': No such file or directory
Setting permissions for public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/app/storage
[conteo@www.conteoregresivo.com] (staging) chmod: cannot access `public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/app/storage': No such file or directory
Setting permissions for public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/public
[conteo@www.conteoregresivo.com] (staging) chmod: cannot access `public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/public': No such file or directory
[conteo@www.conteoregresivo.com] (staging) mv: cannot stat `public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/app/storage/logs': No such file or directory
Sharing file public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/app/storage/logs
Sharing file public_html/staging.conteoregresivo.com/conteo-regresivo/releases/20140911232448/app/storage/sessions