| Q | A
| ----------------- | ---
| Issue Type | Question
| Deployer Version | 6.0.3
| Local Machine OS | Elementary OS 0.4.1 Loki
| Remote Machine OS | Ubuntu 16.04
Hello,
I have a unique issue right here. After deploy laravel webapp, deployment is successful with current symlink folder already on latest release. Then I visit webapp that I deploy before, but there is no update, after I check it, it still on old release.
Let me know, why this is happen.
P.S. old release on 14 and latest release on 18
dep deploy
deploy.php<?php
namespace Deployer;
require 'recipe/laravel.php';
// Project name
set('application', 'cms');
set('ssh_multiplexing', true);
set('repository', '[email protected]:test-team/test.git');
set('clear_use_sudo', true);
set('keep_releases', 5);
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);
// Shared files/dirs between deploys
add('shared_files', []);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts
host('client.test.com')
->set('deploy_path', '/var/www/{{application}}')
->identityFile('~/.ssh/id_rsa')
->forwardAgent(true)
->addSshOption('UserKnownHostsFile', '/dev/null')
->addSshOption('StrictHostKeyChecking', 'no');
// Tasks
task('build', function () {
run('cd {{release_path}} && build');
});
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// Migrate database before symlink new release.
before('deploy:symlink', 'artisan:migrate');
[localhost] > git rev-parse --abbrev-ref HEAD
[localhost] < master
✈︎ Deploying master on client.tes.com
• done on [client.tes.com]
➤ Executing task deploy:prepare
[client.tes.com] > echo $0
[client.tes.com] < ssh multiplexing initialization
[client.tes.com] < Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1031-aws x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
131 packages can be updated.
0 updates are security updates.
*** System restart required ***
[client.tes.com] < bash
[client.tes.com] > if [ ! -d /var/www/cms ]; then mkdir -p /var/www/cms; fi
[client.tes.com] > if [ ! -L /var/www/cms/current ] && [ -d /var/www/cms/current ]; then echo 'true'; fi
[client.tes.com] > cd /var/www/cms && if [ ! -d .dep ]; then mkdir .dep; fi
[client.tes.com] > cd /var/www/cms && if [ ! -d releases ]; then mkdir releases; fi
[client.tes.com] > cd /var/www/cms && if [ ! -d shared ]; then mkdir shared; fi
• done on [client.tes.com]
✔ Ok [13s 235ms]
➤ Executing task deploy:lock
[client.tes.com] > if [ -f /var/www/cms/.dep/deploy.lock ]; then echo 'true'; fi
[client.tes.com] > touch /var/www/cms/.dep/deploy.lock
• done on [client.tes.com]
✔ Ok [2s 342ms]
➤ Executing task deploy:release
[client.tes.com] > cd /var/www/cms && (if [ -h release ]; then echo 'true'; fi)
[client.tes.com] > cd /var/www/cms && (if [ -d releases ] && [ "$(ls -A releases)" ]; then echo 'true'; fi)
[client.tes.com] < true
[client.tes.com] > cd /var/www/cms && (cd releases && ls -t -1 -d */)
[client.tes.com] < 19/
[client.tes.com] < 18/
[client.tes.com] < 17/
[client.tes.com] < 16/
[client.tes.com] < 15/
[client.tes.com] > cd /var/www/cms && (if [ -f .dep/releases ]; then echo 'true'; fi)
[client.tes.com] < true
[client.tes.com] > cd /var/www/cms && (tail -n 15 .dep/releases)
[client.tes.com] < 20171123042223,5
[client.tes.com] < 20171123104634,6
[client.tes.com] < 20171204033115,7
[client.tes.com] < 20171204113731,8
[client.tes.com] < 20171205030117,9
[client.tes.com] < 20171205074119,10
[client.tes.com] < 20171205094210,11
[client.tes.com] < 20171205094552,12
[client.tes.com] < 20171205095146,13
[client.tes.com] < 20171205132243,14
[client.tes.com] < 20171205132810,15
[client.tes.com] < 20171207084049,16
[client.tes.com] < 20171207084420,17
[client.tes.com] < 20171207085227,18
[client.tes.com] < 20171207093903,19
[client.tes.com] > cd /var/www/cms && (if [ -d /var/www/cms/releases/20 ]; then echo 'true'; fi)
[client.tes.com] > cd /var/www/cms && (date +"%Y%m%d%H%M%S")
[client.tes.com] < 20171207094337
[client.tes.com] > cd /var/www/cms && (echo '20171207094337,20' >> .dep/releases)
[client.tes.com] > cd /var/www/cms && (mkdir /var/www/cms/releases/20)
[client.tes.com] > cd /var/www/cms && (if [[ $(man ln 2>&1 || ln -h 2>&1 || ln --help 2>&1) =~ '--relative' ]]; then echo 'true'; fi)
[client.tes.com] < true
[client.tes.com] > cd /var/www/cms && (ln -nfs --relative /var/www/cms/releases/20 /var/www/cms/release)
• done on [client.tes.com]
✔ Ok [13s 258ms]
➤ Executing task deploy:update_code
[client.tes.com] > if hash command 2>/dev/null; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > command -v 'git'
[client.tes.com] < /usr/bin/git
[client.tes.com] > /usr/bin/git version
[client.tes.com] < git version 2.7.4
[client.tes.com] > if [ -h /var/www/cms/release ]; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > readlink /var/www/cms/release
[client.tes.com] < releases/20
[client.tes.com] > /usr/bin/git clone -b master --recursive -q --reference /var/www/cms/releases/19 --dissociate [email protected]:byonchat-team/bc-workforce.git /var/www/cms/releases/20 2>&1
Warning: Permanently added 'client.tes.com,34.194.226.218' (ECDSA) to the list of known hosts.
Counting objects: 721, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (313/313), done.
Writing objects: 100% (721/721), done.
Total 721 (delta 365), reused 721 (delta 365)
Connection to client.tes.com closed.
• done on [client.tes.com]
✔ Ok [13s 793ms]
➤ Executing task deploy:shared
[client.tes.com] > if [ -d /var/www/cms/shared/storage ]; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > rm -rf /var/www/cms/releases/20/storage
[client.tes.com] > mkdir -p `dirname /var/www/cms/releases/20/storage`
[client.tes.com] > ln -nfs --relative /var/www/cms/shared/storage /var/www/cms/releases/20/storage
[client.tes.com] > mkdir -p /var/www/cms/shared/.
[client.tes.com] > if [ -f /var/www/cms/shared/.env ]; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > if [ -f $(echo /var/www/cms/releases/20/.env) ]; then rm -rf /var/www/cms/releases/20/.env; fi
[client.tes.com] > if [ ! -d $(echo /var/www/cms/releases/20/.) ]; then mkdir -p /var/www/cms/releases/20/.;fi
[client.tes.com] > touch /var/www/cms/shared/.env
[client.tes.com] > ln -nfs --relative /var/www/cms/shared/.env /var/www/cms/releases/20/.env
• done on [client.tes.com]
✔ Ok [11s 439ms]
➤ Executing task deploy:vendors
[client.tes.com] > if hash unzip 2>/dev/null; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > if hash composer 2>/dev/null; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > if hash command 2>/dev/null; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > command -v 'composer'
[client.tes.com] < /usr/bin/composer
[client.tes.com] > if hash command 2>/dev/null; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > command -v 'php'
[client.tes.com] < /usr/bin/php
[client.tes.com] > cd /var/www/cms/releases/20 && /usr/bin/php /usr/bin/composer install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader
[client.tes.com] < Cannot create cache directory /home/app/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
[client.tes.com] < Cannot create cache directory /home/app/.composer/cache/files/, or directory is not writable. Proceeding without cache
[client.tes.com] < Loading composer repositories with package information
[client.tes.com] < Installing dependencies from lock file
[client.tes.com] < Dependency resolution completed in 0.000 seconds
[client.tes.com] < Analyzed 102 packages to resolve dependencies
[client.tes.com] < Analyzed 210 rules to resolve dependencies
[client.tes.com] < Package operations: 46 installs, 0 updates, 0 removals
[client.tes.com] < Installs: doctrine/lexer:v1.0.1, doctrine/annotations:v1.5.0, doctrine/cache:v1.7.1, doctrine/collections:v1.5.0, doctrine/inflector:v1.2.0, doctrine/common:v2.8.1, doctrine/dbal:v2.6.2, erusev/parsedown:1.6.3, vlucas/phpdotenv:v2.4.0, symfony/css-selector:v3.3.11, tijsverkoyen/css-to-inline-styles:2.2.0, symfony/polyfill-mbstring:v1.6.0, symfony/var-dumper:v3.3.11, symfony/routing:v3.3.11, symfony/process:v3.3.11, symfony/http-foundation:v3.3.11, symfony/event-dispatcher:v3.3.11, psr/log:1.0.2, symfony/debug:v3.3.11, symfony/http-kernel:v3.3.11, symfony/finder:v3.3.11, symfony/console:v3.3.11, egulias/email-validator:2.1.2, swiftmailer/swiftmailer:v6.0.2, paragonie/random_compat:v2.0.11, ramsey/uuid:3.7.1, psr/simple-cache:1.0.0, psr/container:1.0.0, symfony/translation:v3.3.11, nesbot/carbon:1.22.1, mtdowling/cron-expression:v1.2.1, monolog/monolog:1.23.0, league/flysystem:1.0.41, laravel/framework:v5.5.20, fideloper/proxy:3.3.4, jakub-onderka/php-console-color:0.1, laracasts/flash:3.0.2, nikic/php-parser:v3.1.2, jakub-onderka/php-console-highlighter:v0.3.2, dnoegel/php-xdg-base-dir:0.1, psy/psysh:v0.8.14, laravel/tinker:v1.0.2, nwidart/laravel-modules:2.6.0, kkszymanowski/traitor:0.2.4, santigarcor/laratrust:5.0.2, uxweb/sweet-alert:1.4.2
[client.tes.com] < - Installing doctrine/lexer (v1.0.1): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing doctrine/annotations (v1.5.0): Downloading (100%)
[client.tes.com] < Extracting archive - Installing doctrine/cache (v1.7.1): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing doctrine/collections (v1.5.0): Downloading (100%)
[client.tes.com] < Extracting archive - Installing doctrine/inflector (v1.2.0): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing doctrine/common (v2.8.1): Downloading (100%)
[client.tes.com] < Extracting archive - Installing doctrine/dbal (v2.6.2): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing erusev/parsedown (1.6.3):
[client.tes.com] < Downloading (100%)
[client.tes.com] < Extracting archive - Installing vlucas/phpdotenv (v2.4.0): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing symfony/css-selector (v3.3.11): Downloading (100%)
[client.tes.com] < Extracting archive - Installing tijsverkoyen/css-to-inline-styles (2.2.0): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing symfony/polyfill-mbstring (v1.6.0):
[client.tes.com] < Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing symfony/var-dumper (v3.3.11): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing symfony/routing (v3.3.11): Downloading (100%)
[client.tes.com] < Extracting archive - Installing symfony/process (v3.3.11): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing symfony/http-foundation (v3.3.11):
[client.tes.com] < Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing symfony/event-dispatcher (v3.3.11): Downloading (100%)
[client.tes.com] < Extracting archive - Installing psr/log (1.0.2): Downloading (100%)
[client.tes.com] < Extracting archive - Installing symfony/debug (v3.3.11): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing symfony/http-kernel (v3.3.11): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing symfony/finder (v3.3.11):
[client.tes.com] < Downloading (100%)
[client.tes.com] < Extracting archive - Installing symfony/console (v3.3.11): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing egulias/email-validator (2.1.2): Downloading (100%)
[client.tes.com] < Extracting archive - Installing swiftmailer/swiftmailer (v6.0.2): Downloading (100%)
[client.tes.com] < Extracting archive - Installing paragonie/random_compat (v2.0.11): Downloading (100%)
[client.tes.com] < Extracting archive - Installing ramsey/uuid (3.7.1): Downloading (100%)
[client.tes.com] < Extracting archive - Installing psr/simple-cache (1.0.0): Downloading (100%)
[client.tes.com] < Extracting archive - Installing psr/container (1.0.0): Downloading (100%)
[client.tes.com] < Extracting archive - Installing symfony/translation (v3.3.11): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing nesbot/carbon (1.22.1): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing mtdowling/cron-expression (v1.2.1): Downloading (100%)
[client.tes.com] < Extracting archive - Installing monolog/monolog (1.23.0): Downloading (100%)
[client.tes.com] < Extracting archive - Installing league/flysystem (1.0.41): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing laravel/framework (v5.5.20):
[client.tes.com] < Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing fideloper/proxy (3.3.4): Downloading (100%)
[client.tes.com] < Extracting archive - Installing jakub-onderka/php-console-color (0.1): Downloading (100%)
[client.tes.com] < Extracting archive - Installing laracasts/flash (3.0.2): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing nikic/php-parser (v3.1.2):
[client.tes.com] < Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing jakub-onderka/php-console-highlighter (v0.3.2): Downloading (100%)
[client.tes.com] < Extracting archive - Installing dnoegel/php-xdg-base-dir (0.1): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing psy/psysh (v0.8.14): Downloading (100%)
[client.tes.com] < Extracting archive - Installing laravel/tinker (v1.0.2): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing nwidart/laravel-modules (2.6.0): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < - Installing kkszymanowski/traitor (0.2.4): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing santigarcor/laratrust (5.0.2): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive - Installing uxweb/sweet-alert (1.4.2): Downloading
[client.tes.com] < (100%)
[client.tes.com] < Extracting archive
[client.tes.com] < Generating optimized autoload files
[client.tes.com] < > post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
[client.tes.com] < > post-autoload-dump: @php artisan package:discover
[client.tes.com] < Discovered Package: fideloper/proxy
[client.tes.com] < Discovered Package: laracasts/flash
[client.tes.com] < Discovered Package: laravel/tinker
[client.tes.com] < Discovered Package: nwidart/laravel-modules
[client.tes.com] < Discovered Package: santigarcor/laratrust
[client.tes.com] < Discovered Package: uxweb/sweet-alert
[client.tes.com] < Package manifest generated successfully.
• done on [client.tes.com]
✔ Ok [15s 640ms]
➤ Executing task deploy:writable
[client.tes.com] > ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1
[client.tes.com] < www-data
[client.tes.com] > cd /var/www/cms/releases/20 && (mkdir -p bootstrap/cache storage storage/app storage/app/public storage/framework storage/framework/cache storage/framework/sessions storage/framework/views storage/logs)
[client.tes.com] > cd /var/www/cms/releases/20 && (chmod 2>&1; true)
[client.tes.com] < chmod: missing operand
[client.tes.com] < Try 'chmod --help' for more information.
[client.tes.com] > cd /var/www/cms/releases/20 && (if hash setfacl 2>/dev/null; then echo 'true'; fi)
[client.tes.com] < true
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p bootstrap/cache | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] > cd /var/www/cms/releases/20 && (setfacl -RL -m u:"www-data":rwX -m u:`whoami`:rwX bootstrap/cache)
[client.tes.com] > cd /var/www/cms/releases/20 && (setfacl -dRL -m u:"www-data":rwX -m u:`whoami`:rwX bootstrap/cache)
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage/app | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage/app/public | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage/framework | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage/framework/cache | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage/framework/sessions | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage/framework/views | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
[client.tes.com] > cd /var/www/cms/releases/20 && (getfacl -p storage/logs | grep "^user:www-data:.*w" | wc -l)
[client.tes.com] < 1
• done on [client.tes.com]
✔ Ok [17s 320ms]
➤ Executing task artisan:storage:link
[client.tes.com] > /usr/bin/php /var/www/cms/releases/20/artisan --version
[client.tes.com] < Laravel Framework 5.5.20
[client.tes.com] > /usr/bin/php /var/www/cms/releases/20/artisan storage:link
[client.tes.com] < The [public/storage] directory has been linked.
• done on [client.tes.com]
✔ Ok [2s 473ms]
➤ Executing task artisan:view:clear
[client.tes.com] > /usr/bin/php /var/www/cms/releases/20/artisan view:clear
[client.tes.com] < Compiled views cleared!
• done on [client.tes.com]
✔ Ok [1s 238ms]
➤ Executing task artisan:cache:clear
[client.tes.com] > /usr/bin/php /var/www/cms/releases/20/artisan cache:clear
[client.tes.com] < Cache cleared successfully.
• done on [client.tes.com]
✔ Ok [1s 453ms]
➤ Executing task artisan:config:cache
[client.tes.com] > /usr/bin/php /var/www/cms/releases/20/artisan config:cache
[client.tes.com] < Configuration cache cleared!
[client.tes.com] < Configuration cached successfully!
• done on [client.tes.com]
✔ Ok [1s 422ms]
➤ Executing task artisan:optimize
• done on [client.tes.com]
✔ Ok [1ms]
➤ Executing task artisan:migrate
[client.tes.com] > /usr/bin/php /var/www/cms/releases/20/artisan migrate --force
[client.tes.com] < Nothing to migrate.
• done on [client.tes.com]
✔ Ok [1s 274ms]
➤ Executing task deploy:symlink
[client.tes.com] > if [[ $(man mv 2>&1 || mv -h 2>&1 || mv --help 2>&1) =~ '--no-target-directory' ]]; then echo 'true'; fi
[client.tes.com] < true
[client.tes.com] > mv -T /var/www/cms/release /var/www/cms/current
• done on [client.tes.com]
✔ Ok [2s 380ms]
➤ Executing task deploy:unlock
[client.tes.com] > rm -f /var/www/cms/.dep/deploy.lock
• done on [client.tes.com]
✔ Ok [1s 185ms]
➤ Executing task cleanup
[client.tes.com] > rm -rf /var/www/cms/releases/15
[client.tes.com] > cd /var/www/cms && if [ -e release ]; then rm release; fi
[client.tes.com] > cd /var/www/cms && if [ -h release ]; then rm release; fi
• done on [client.tes.com]
✔ Ok [5s 265ms]
Successfully deployed!
It's opcache. Restart server. Or https://deployer.org/recipes/cachetool
Hi anton,
Thanks for response btw,
I would like to implement cachetool recipe, but I can't require it on deploy.php
PHP Warning: require_once(recipe/cachetool.php): failed to open stream: No such file or directory in /home/bayucakra20/Labs/projects/bc-workforce/deploy.php on line 5
PHP Fatal error: require_once(): Failed opening required 'recipe/cachetool.php' (include_path='phar:///usr/local/bin/dep/bin/../:.:/usr/share/php') in /home/bayucakra20/Labs/projects/bc-workforce/deploy.php on line 5
Use full path
Hi anton,
How to use sudo while run opcache? I've got permission denied while run cachetool:clear:opcache
[Deployer\Exception\RuntimeException]
The command "cd /var/www/cms/releases/22 && (/usr/bin/php cachetool.phar opcache:reset )" failed.
Exit Code: 1 (General error)
Host Name: client.tes.com
================
PHP Warning: fsockopen(): unable to connect to unix:///var/run/php/php7.1-fpm.sock:-1 (Permission denied) in phar:///var/www/cms/releases/22/cachetool.phar/vendor/a
doy/fastcgi-client/src/Adoy/FastCGI/Client.php on line 255
[RuntimeException]
FastCGI error: Unable to connect to FastCGI application: Permission denied
(/var/run/php/php7.1-fpm.sock)
[Exception]
Unable to connect to FastCGI application: Permission denied
opcache:reset
Take a look at sudores
Most helpful comment
It's opcache. Restart server. Or https://deployer.org/recipes/cachetool