Laravel Envoyer & FreeBSD mv: illegal option — T

James Mills > Laravel > Laravel Envoyer & FreeBSD mv: illegal option — T

UPDATE

Originally Taylor tried to ‘lookup’ the operating system you were using and then use the correct command. Unfortunately, this broke things for other users so he had to roll it back.

So he has now included a config option


I have been meaning to try Laravel Envoyer for some time now. At work we have a deployment process which is mainly focused around Codeship with some custom scripts that are either on the server or committed to the repo.

Although there are many options for zero downtime deployment I really like the idea of using Envoyer so I decided to give it a go. Nearly all of our servers are FreeBSD for various reasons and as I excitedly watched the deployment happen for the first time I was disappointed when I saw ‘Finished With Errors’. I clicked on the output button with provides you with some more feedback and I was faced with a rather confusing message.

mv: illegal option -- T
usage: mv [-f | -i | -n] [-hv] source target
mv [-f | -i | -n] [-v] source ... directory

screenshot-2016-09-29-09-10-11

It looks like the option -T is not available on FreeBSD as it is in Linux systems so the final step where Envoyer activates the new release is not able to move the ‘current-temp’ folder to be the ‘current’ folder.

mv -Tf /home/forge/domain.com/current-temp /home/forge/domain.com/current

I sent a tweet out to see if anyone else was having this issue or if it was something I was doing wrong. I got a helpful tweet back from @FreeBSDhelp which confirmed that the option -T was not available.

Interestingly if you run the move command without the -T and you already have a current folder it will place the ‘current-temp’ folder inside the ‘current’ folder resulting in ‘/home/forge/domain.com/current/current-temp/’, obviously not what we are looking for. So it looks like the option in FreeBSD is to replace the -T option with -h which will do a similar thing.

So for FreeBSD we need to run

mv -hf /home/forge/domain.com/current-temp /home/forge/domain.com/current

and on all other we can run

mv -Tf /home/forge/domain.com/current-temp /home/forge/domain.com/current

I have exchanged a couple of emails with Taylor and I hope that we will see this merged into Envoyer soon so that I can continue my trial of the product.

I would love to hear from anyone else who has had the same issue.

One thought on “Laravel Envoyer & FreeBSD mv: illegal option — T

Leave a Reply

Your email address will not be published. Required fields are marked *