REBELinBLUE / deployer

Deployer is a free and open source deployment tool.
http://phpdeployment.org
MIT License
909 stars 185 forks source link

git-archive-all.sh does not work with bash 3 #381

Closed robindirksen1 closed 6 years ago

robindirksen1 commented 6 years ago

Before submitting your issue, please make sure that you've checked all of the checkboxes below.

Describe the bug

After trying to deploy the project to a server it gots the status "failed". All steps get the status "cancelled".

Expected behaviour

See a log what's wrong

Actual behaviour

Only see the new status

Steps to reproduce


Screenshots


Environment info

Visit /admin/sysinfo on your install and click the "Get System Report" button. Paste the report here, if you can't please provide the following instead.

### Laravel Environment

 - Laravel Version: 5.5.40
 - Timezone: Europe/Amsterdam
 - Debug Mode: ✔
 - Storage Dir Writable: ✔
 - Cache Dir Writable: ✔
 - Decomposer Version: ^1.0
 - App Size: 3 GB

 ### Server Environment

 - PHP Version: 7.1.17
 - Server Software: nginx/1.13.11
 - Server OS: Darwin MacBook-Pro-van-user.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
 - Database: mysql
 - SSL Installed: ✔
 - Cache Driver: file
 - Session Driver: file
 - Openssl Ext: ✔
 - PDO Ext: ✔
 - Mbstring Ext: ✔
 - Tokenizer Ext: ✔
 - XML Ext: ✔
 - Curl Ext: ✔
 - GD Ext: ✔
 - JSON Ext: ✔

 ### Installed Packages & their version numbers

 - andywer/js-localization : dev-laravel-5
 - backup-manager/laravel : ^1.1
 - creativeorange/gravatar : ~1.0
 - doctrine/dbal : 2.5.13
 - fideloper/proxy : ^3.3
 - graham-campbell/binput : ~4.0
 - guzzlehttp/guzzle : ^6.2
 - htmlmin/htmlmin : ~5.0
 - intervention/image : ^2.3
 - laracademy/interactive-make : ^1.1
 - laravel-notification-channels/hipchat : ~1.0
 - laravel-notification-channels/twilio : ~2.0.1
 - laravel-notification-channels/webhook : ~1.1.0
 - laravel/framework : ^5.5
 - laravel/tinker : 1.0.*
 - lubusin/laravel-decomposer : ^1.0
 - mccool/laravel-auto-presenter : ^6.2
 - melihovv/laravel-log-viewer : ^5.5
 - michele-angioni/multi-language : 0.4
 - pda/pheanstalk : ~3.1
 - pragmarx/google2fa : ^1.0.0
 - predis/predis : ~1.0
 - rebelinblue/laravel5-zxcvbn : ^1.0.0
 - tymon/jwt-auth : ~0.5
 - version/version : ^2.2

 ### Extra Information

 - proc_open enabled : ✔

Logs (see storage/logs/) or other output that would be helpful

[2018-06-20 13:08:35] production.ERROR: Cloning into '/Users/user/websites/laravel-application-deployer/storage/app/tmp/clone_3_20180620130825'...
warning: --depth is ignored in local clones; use file:// instead.
done.
Note: checking out '744d465d0f3592c7c03cb8e4d9001f5cb732cfed'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 744d465d... wip
/Users/user/websites/laravel-application-deployer/resources/scripts/tools/GitArchiveAll.sh: line 271:  -3: substring expression < 0
mv: rename /var/folders/k0/p8mj27ms7z3frb_2h4pv_sbc0000gn/T//clone_3_20180620130825.tar.gz to /Users/user/websites/laravel-application-deployer/storage/app/3_20180620130823.tar.gz: No such file or directory
REBELinBLUE commented 6 years ago

Hmm, can you tell me which version of bash you are using on the deployer server? bash --version

This is a stand part of bash for a long time as far as I am aware superfile=${superfile:0: -3} to remove the last 3 characters from a string

robindirksen1 commented 6 years ago

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)

REBELinBLUE commented 6 years ago

OK yeah it looks like the feature isn't supported on bash 3. Can you try changing line 271 from superfile=${superfile:0: -3} to superfile=${superfile%???} and line 274 from file=${file:0: -3} to file=${file%???}

robindirksen1 commented 6 years ago

Looks likes it's fixed.

REBELinBLUE commented 6 years ago

Great, I'll merge the fix

robindirksen1 commented 6 years ago

Wait, i’ll test it on another mac...