oraclebase / vagrant

Vagrant Builds
https://oracle-base.com/
GNU General Public License v3.0
190 stars 167 forks source link

Using Git on Windows Fail on "default: Running: inline script" #2

Closed levipereira closed 5 years ago

levipereira commented 5 years ago

The issue:

PS V:\Virtual_Box\vagrant\rac\ol7_183\dns> vagrant up --provision
==> default: Running provisioner: shell...
    default: Running: inline script
: No such file or directorycripts/root_setup.sh
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

How to fix it: Download the dos2unix and convert all scritps files to unix format.

V:\Virtual_Box\vagrant\rac\ol7_183\node2\scripts>dos2unix *
dos2unix: Skipping ., not a regular file.
dos2unix: Skipping .., not a regular file.
dos2unix: converting file oracle_user_environment_setup.sh to Unix format...
dos2unix: converting file root_setup.sh to Unix format...
dos2unix: converting file setup.sh to Unix format...

Do it for all files that will run on Linux.

\ol7_183\shared_scripts* node1\script* node2\script* dns\script*

Just sharing the solution

oraclebase commented 5 years ago

Hi.

The issue is your git settings. You are not cloning "as-is", but converting all line terminators to Windows style CRLF, which is breaking the build. Solutions to this are:

1) Getting your repository Git settings correct, so it checks code out "as-is".

2) I add a ".gitattributes" file containing "* text eol=lf", which forces the situation for this repo. I've just done this, but I'm checking it's not broken the builds. It's going to take a while. :)

3) You use dos2unix on the relevant files, but remember, this will be seen as an edit to every file, which is going to be necessary ever time you do a pull. On the server these files all have the correct line terminators.

Let's see how option (2) goes. It might fix your issue for you, but it's worth remembering this in future, as your Git setting for each repository may need to be considered.

Cheers

Tim...

oraclebase commented 5 years ago

Since adding the ".gitattributes", the builds on Windows seem to work fine, regardless of your default git config.

levipereira commented 5 years ago

Perfect!!! It worked smoothly. Will make a Youtube (in my language) using your project. Of course the credits it's your.

oraclebase commented 5 years ago

:)

On Tue, Oct 9, 2018 at 7:47 PM Levi Pereira notifications@github.com wrote:

Perfect!!! It worked smoothly. Will make a Youtube (in my language) using your project. Of course the credits it's your.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/oraclebase/vagrant/issues/2#issuecomment-428306694, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1oLsIIvveFdUPcuYwaKflRfqYDjL7Cks5ujO9WgaJpZM4XLIkL .