{"action":"created","issue":{"url":"https://api.github.com/repos/deployphp/deployer/issues/903","repository_url":"https://api.github.com/repos/deployphp/deployer","labels_url":"https://api.github.com/repos/deployphp/deployer/issues/903/labels{/name}","comments_url":"https://api.github.com/repos/deployphp/deployer/issues/903/comments","events_url":"https://api.github.com/repos/deployphp/deployer/issues/903/events","html_url":"https://github.com/deployphp/deployer/issues/903","id":191665112,"number":903,"title":"Rollback symlinks incorrectly every other rollback","user":{"login":"kirkdocker","id":9040251,"avatar_url":"https://avatars.githubusercontent.com/u/9040251?v=3","gravatar_id":"","url":"https://api.github.com/users/kirkdocker","html_url":"https://github.com/kirkdocker","followers_url":"https://api.github.com/users/kirkdocker/followers","following_url":"https://api.github.com/users/kirkdocker/following{/other_user}","gists_url":"https://api.github.com/users/kirkdocker/gists{/gist_id}","starred_url":"https://api.github.com/users/kirkdocker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirkdocker/subscriptions","organizations_url":"https://api.github.com/users/kirkdocker/orgs","repos_url":"https://api.github.com/users/kirkdocker/repos","events_url":"https://api.github.com/users/kirkdocker/events{/privacy}","received_events_url":"https://api.github.com/users/kirkdocker/received_events","type":"User","site_admin":false},"labels":[{"id":47395261,"url":"https://api.github.com/repos/deployphp/deployer/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-25T10:02:10Z","updated_at":"2016-12-18T09:13:55Z","closed_at":"2016-12-12T16:41:51Z","body":"| Q                 | A\r\n| ----------------- | ---\r\n| Issue Type        | Bug\r\n| Deployer Version  | 4.0.1\r\n| Local Machine OS  | Windows (git bash)\r\n| Remote Machine OS | Ubuntu (vagrant)\r\n\r\n### Description \r\nPerforming multiple rollbacks causes the **current** symlink to not link correctly on every second rollback.\r\n\r\n![deployer-rollback](https://cloud.githubusercontent.com/assets/9040251/20621380/2c26379e-b2f6-11e6-9f9d-68b6f14a626f.jpg)\r\n\r\n### Steps to reproduce\r\nDeploy application multiple times. Then perform a rollback. \r\n\r\nAfter each rollback, perform a **ls -al** on the destination server, app directory. The 'current' symlink fails on every other rollback. It links to the directory **3** for example, instead of **releases/3**. But on the next rollback it will link correctly.\r\n\r\n### Content of `deploy.php`\r\n```php\r\n<?php\r\nnamespace Deployer;\r\nrequire 'recipe/laravel.php';\r\n\r\n// Configuration\r\n\r\nset('repository', 'git@git.SITE.com:kirk.docker/status-page.git');\r\n\r\nserver('vagrant', '127.0.0.1', '2222')\r\n    ->user('vagrant')\r\n    ->password('vagrant')\r\n    ->set('deploy_path', '/var/www/local-status.SITE.com');\r\n```\r\n\r\n### Output log\r\n```\r\n$ dep rollback -vvv\r\nÔ×ñ Executing task rollback\r\n[vagrant] > cd /var/www/local-status.SITE.com && ([ -d releases ] && [ \"$(ls -A releases)\" ] && echo \"true\" || echo \"false\")\r\n[vagrant] < true\r\n[vagrant] > cd /var/www/local-status.SITE.com && (cd releases && ls -t -d */)\r\n[vagrant] < 5/\r\n[vagrant] < 4/\r\n[vagrant] < 3/\r\n[vagrant] < 2/\r\n[vagrant] < 1/\r\n[vagrant] > cd /var/www/local-status.SITE.com && (if [ -f .dep/releases ]; then echo \"true\"; fi)\r\n[vagrant] < true\r\n[vagrant] > cd /var/www/local-status.SITE.com && (tail -n 10 .dep/releases)\r\n[vagrant] < 20161123143722,1\r\n[vagrant] < 20161123144037,1\r\n[vagrant] < 20161123144633,1\r\n[vagrant] < 20161123144955,2\r\n[vagrant] < 20161123151343,2\r\n[vagrant] < 20161124165527,3\r\n[vagrant] < 20161124165542,4\r\n[vagrant] < 20161124165555,5\r\n[vagrant] > cd /var/www/local-status.SITE.com && (if [[ \"$(man ln)\" =~ \"--relative\" ]]; then echo \"true\"; fi)\r\n[vagrant] < true\r\n[vagrant] > cd /var/www/local-status.SITE.com && (cd /var/www/local-status.SITE.com && ln -nfs --relative /var/www/local-status.SITE.com/releases/4 current)\r\n[vagrant] > cd /var/www/local-status.SITE.com && (rm -rf /var/www/local-status.SITE.com/releases/5)\r\nRollback to `4` release was successful.\r\nÔÇó done on [vagrant]\r\nÔ£ö Ok [518ms]\r\n\r\nKirkD@HRT-PC07 MINGW64 /c/xampp/htdocs/status-page (deployment)\r\n$ dep rollback -vvv\r\nÔ×ñ Executing task rollback\r\n[vagrant] > cd /var/www/local-status.SITE.com && ([ -d releases ] && [ \"$(ls -A releases)\" ] && echo \"true\" || echo \"false\")\r\n[vagrant] < true\r\n[vagrant] > cd /var/www/local-status.SITE.com && (cd releases && ls -t -d */)\r\n[vagrant] < 4/\r\n[vagrant] < 3/\r\n[vagrant] < 2/\r\n[vagrant] < 1/\r\n[vagrant] > cd /var/www/local-status.SITE.com && (if [ -f .dep/releases ]; then echo \"true\"; fi)\r\n[vagrant] < true\r\n[vagrant] > cd /var/www/local-status.SITE.com && (tail -n 10 .dep/releases)\r\n[vagrant] < 20161123143722,1\r\n[vagrant] < 20161123144037,1\r\n[vagrant] < 20161123144633,1\r\n[vagrant] < 20161123144955,2\r\n[vagrant] < 20161123151343,2\r\n[vagrant] < 20161124165527,3\r\n[vagrant] < 20161124165542,4\r\n[vagrant] < 20161124165555,5\r\n[vagrant] > cd /var/www/local-status.SITE.com && (if [[ \"$(man ln)\" =~ \"--relative\" ]]; then echo \"true\"; fi)\r\n[vagrant] < true\r\n[vagrant] > cd /var/www/local-status.SITE.com && (cd /var/www/local-status.SITE.com && ln -nfs --relative /var/www/local-status.SITE.com/releases/3 current)\r\n[vagrant] > cd /var/www/local-status.SITE.com && (rm -rf /var/www/local-status.SITE.com/releases/4)\r\nRollback to `3` release was successful.\r\nÔÇó done on [vagrant]\r\nÔ£ö Ok [545ms]\r\n```\r\n\r\nI've diffed the output and each rollback produces essentially identical info. Does this happen to anyone else, or is it something to do with my config?\r\n \r\n"},"comment":{"url":"https://api.github.com/repos/deployphp/deployer/issues/comments/267810993","html_url":"https://github.com/deployphp/deployer/issues/903#issuecomment-267810993","issue_url":"https://api.github.com/repos/deployphp/deployer/issues/903","id":267810993,"user":{"login":"elfet","id":141232,"avatar_url":"https://avatars.githubusercontent.com/u/141232?v=3","gravatar_id":"","url":"https://api.github.com/users/elfet","html_url":"https://github.com/elfet","followers_url":"https://api.github.com/users/elfet/followers","following_url":"https://api.github.com/users/elfet/following{/other_user}","gists_url":"https://api.github.com/users/elfet/gists{/gist_id}","starred_url":"https://api.github.com/users/elfet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elfet/subscriptions","organizations_url":"https://api.github.com/users/elfet/orgs","repos_url":"https://api.github.com/users/elfet/repos","events_url":"https://api.github.com/users/elfet/events{/privacy}","received_events_url":"https://api.github.com/users/elfet/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T09:13:55Z","updated_at":"2016-12-18T09:13:55Z","body":"@stz184 deployer detect is system supports relative symlinks and then use it. Otherwise use in without this option. "}}
{"actor":{"display_login":"elfet"}}