vendredi 29 mars 2019

In envoy error referring db at composer installing step

In laravel 5.8 I run envoy command and it is supposed that new release is uploaded to new subdirecory and after the project is cloned and composer installed .env file would be copied to the project. But running command I got error referring db, as .env is not found:

$ envoy run VotesDeploy
lardeployer@NNN.NN.NNN.N's password: 
[lardeployer@NNN.NN.NNN.N]: $release_number :: /var/www/html/VotesDeployed/release/20190329095641
[lardeployer@NNN.NN.NNN.N]: $database_factories_path :: /var/www/html/VotesDeployed/release/20190329095641/database/factories
[lardeployer@NNN.NN.NNN.N]: $git_clone_command git clone --depth 1 -b master "git@bitbucket.org:myaccount/votes.git"  "/var/www/html/VotesDeployed/release/20190329095641"::
[lardeployer@NNN.NN.NNN.N]: Cloning into '/var/www/html/VotesDeployed/release/20190329095641'...
[lardeployer@NNN.NN.NNN.N]: Checking out files:  13% (198/1468)
...
[lardeployer@NNN.NN.NNN.N]: Checking out files: 100% (1468/1468)
[lardeployer@NNN.NN.NNN.N]: Checking out files: 100% (1468/1468), done.
[lardeployer@NNN.NN.NNN.N]: Step # 1 : Repository has been cloned
lardeployer@NNN.NN.NNN.N's password: 
[lardeployer@NNN.NN.NNN.N]: Step # 2 start : composer_installing dependencies installing
[lardeployer@NNN.NN.NNN.N]: Loading composer repositories with package information
[lardeployer@NNN.NN.NNN.N]: Updating dependencies
[lardeployer@NNN.NN.NNN.N]: Package operations: 124 installs, 0 updates, 0 removals
...
[lardeployer@NNN.NN.NNN.N]: Loading from cache
[lardeployer@NNN.NN.NNN.N]: - Installing ratchet/rfc6455 (0.2.4):
[lardeployer@NNN.NN.NNN.N]: Loading from cache
[lardeployer@NNN.NN.NNN.N]: - Installing cboden/ratchet (v0.4.1):
[lardeployer@NNN.NN.NNN.N]: Loading from cache
[lardeployer@NNN.NN.NNN.N]: - Installing beyondcode/laravel-websockets (1.1.1):
[lardeployer@NNN.NN.NNN.N]: Loading from cache
[lardeployer@NNN.NN.NNN.N]: Writing lock file
[lardeployer@NNN.NN.NNN.N]: Generating optimized autoload files
[lardeployer@NNN.NN.NNN.N]: > Illuminate\Foundation\ComposerScripts::postAutoloadDump
[lardeployer@NNN.NN.NNN.N]: > @php artisan package:discover
[lardeployer@NNN.NN.NNN.N]: In Connection.php line 664:
[lardeployer@NNN.NN.NNN.N]: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using pa
[lardeployer@NNN.NN.NNN.N]: ssword: NO) (SQL: select * from information_schema.tables where table_schem
[lardeployer@NNN.NN.NNN.N]: a = forge and table_name = vt2_settings)
[lardeployer@NNN.NN.NNN.N]: In PDOConnection.php line 31:
[lardeployer@NNN.NN.NNN.N]: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using pa
[lardeployer@NNN.NN.NNN.N]: ssword: NO)
[lardeployer@NNN.NN.NNN.N]: In PDOConnection.php line 27:
[lardeployer@NNN.NN.NNN.N]: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using pa
[lardeployer@NNN.NN.NNN.N]: ssword: NO)
[lardeployer@NNN.NN.NNN.N]: Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
[✗] This task did not complete successfully on one of your servers.

My /_wwwroot/lar/DeploymentApps/votes/Envoy.blade.php:

@setup
    // Under directory /mnt/_work_sdb8/wwwroot/lar/DeploymentApps/votes RUN
    // export PATH="$PATH:~/.composer/vendor/bin"
    // envoy run VotesDeploy
    $server_login_user= 'lardeployer';

    $timezone= 'Europe/Kiev';

    $path= '/var/www/html/VotesDeployed';

    $current = $path . '/current';

    // git clone git@bitbucket.org:myaccount/votes.git
    $repo= 'git@bitbucket.org:myaccount/votes.git';

    $branch= 'master';

   // Directory and files with chmod 755
    $writableDirs= [
        '/storage/logs',
        '/bootstrap/cache'
    ];
    $now_date = new DateTime('now', new DateTimeZone($timezone));

    $release_number = $path . '/release/' . $now_date->format('YmdHis');

    $git_clone_command = 'git clone --depth 1 -b '.$branch.' "'.$repo.'" '.' "'.$release_number.'"';

    $database_factories_path= $release_number.'/database/factories';

@endsetup

@servers(['production' => $server_login_user.'@NNN.NN.NNN.N'])


@task( 'clone_project', ['on'=>$on] )

    echo '$release_number :: ';

    echo '$database_factories_path :: ';

    echo '$git_clone_command ::';


    mkdir -p 


    

    mkdir -p 

    echo "Step # 1 : Repository has been cloned";
@endtask


@task( 'composer_installing', ['on'=>$on] )
    cd 

    echo "Step # 2 start : composer_installing dependencies installing";
    composer install --no-interaction --no-dev --prefer-dist

    echo "Step # 2 : composer_installing dependencies has been installed";
@endtask


@task( 'artisan_running', ['on'=>$on] )
    cd 

    ln -nfs /.env .env
    chgrp -h www.data .env

    php artisan config:clear

    php artisan migrate

    php artisan clear-compiled -- env=production

    php artisan optimize --env=production

    echo "Step # 3 : Production dependencies has been installed";
@endtask


@task( 'chmod_settings', ['on'=>$on] )
    chgrp -R www-data 
    chmod -R ug-rwx 

    echo "Step # 4 : chmod_settings = Permissions setting";
    @foreach($writableDirs as $file)
        chmod -R 775 /

        chown -R :www-data /

        echo "Permisions has been for file ";
    @endforeach
    echo "Step # 4 : chmod_settings = Permissions has been set";
@endtask



@task( 'update_symlinks' )
    ln -nfs  ;

    chgrp -h www-data ;
    echo "Step # 5 : Symlink has been set";
@endtask


@macro('VotesDeploy',['on'=>'production'])
    clone_project
    composer_installing
    artisan_running
    chmod_settings
    update_symlinks
@endmacro

Why there is refering to db at composer_installing stage. Error message is :

select * from information_schema.tables where table_schema = forge and table_name = vt2_settings

vt2_settings is my table, but I use it in my controls only. Why it is referred by Illuminate\Foundation\ComposerScripts::postAutoloadDump as I see in error description ?

Any ideas how to fix it?

Thanks!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Yvlvw6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire