git-gurus-itu-devops / itu-minitwit

0 stars 0 forks source link

Fix vagrant script for Windows users #45

Open A-Guldborg opened 3 months ago

A-Guldborg commented 3 months ago

When provisioning a virtual machine through vagrant, it synchronizes files from ./remote_files/ to /minitwit/ in order to call deploy.sh in the deploy pipeline.

However, since line endings are different on Windows and Unix-based machines, the script is unable to run on a unix machine when it is synchronized like this.

It is possible to use dos2unix on the file to remove line endings quickly.

Currently the process is to ssh into the machine after provisioning and running sudo apt install dos2unix and then dos2unix /minitwit/deploy.sh.

According to this article, apt is for interactive use and the current interactive process requires a confirmation so we need to figure out another way to script this effectively to ensure similar behaviour between operating systems.