Install script does not respect multiple commands

Adam Ralph's Avatar

Adam Ralph

31 Jan, 2014 06:24 PM

E.g. I want to:

  1. update the gem system
  2. install some gems

If I enter the following into the 'Install script' box:

gem update --system
gem install rake albacore zip
The entire script is concatenated into one line:
gem update --systemgem install rake albacore zip
(see https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/3).

If I add extra line breaks:

gem update --system


gem install rake albacore zip
then one of the two line breaks is preserved leaving two lines, but both the lines are sent to the command shell at once so the gem system update succeeds and the gem installation fails (see https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/4).

I would expect that each line in the 'Install script' box is executed and allowed to complete before the next line is executed.

  1. Support Staff 1 Posted by Feodor Fitsner on 31 Jan, 2014 06:32 PM

    Feodor Fitsner's Avatar

    I will look into this!

  2. 2 Posted by Adam Ralph on 31 Jan, 2014 06:34 PM

    Adam Ralph's Avatar

    Thank you - I just realised that Ruby is on the machines already so I re-tried with just the gem update and gem installation and I get the same problem (question is now updated).

    I'm not sure why there is such a huge gap in the 'extra line breaks' code sample. In the markdown I just have one blank line between the two commands :/.

  3. Support Staff 3 Posted by Feodor Fitsner on 31 Jan, 2014 06:37 PM

    Feodor Fitsner's Avatar

    Yes, both Ruby and Chocolatey are pre-installed.

    Regarding code blocks in Tender - sometimes it's really weird and definitely it's not like at GitHub.

  4. Support Staff 4 Posted by Feodor Fitsner on 31 Jan, 2014 08:39 PM

    Feodor Fitsner's Avatar

    Wow, this is interesting :)

    Right now AppVeyor runs all commands from "Install" field as a single batch file (by creating temporary .cmd and then running it in the global PS session).

    Apparently, gem command is a batch file thus the very first gem command causes AppVeyor batch to exit - the rest of commands is ignored: http://stackoverflow.com/questions/9773486/batch-file-closes-before...

    The solution is prepending it with "call", but I guess it'd be better do line-by-line execution rather than treating that field as a single script.

    What do you think?

  5. Support Staff 5 Posted by Feodor Fitsner on 31 Jan, 2014 09:12 PM

    Feodor Fitsner's Avatar

    It was UI bug in console rendering function combining multiple lines to a single one.

  6. 6 Posted by Adam Ralph on 31 Jan, 2014 10:45 PM

    Adam Ralph's Avatar

    Thanks for the investigation! In the light of your discoveries all the behaviour makes sense now :-).

    I guess it probably makes sense to do line by line execution. That would be the closest translation of intent, i.e. as if the commands were being entered by the developer in the console, and would follow the principle of least astonishment in case anything goes wrong.

  7. Support Staff 7 Posted by Feodor Fitsner on 31 Jan, 2014 10:54 PM

    Feodor Fitsner's Avatar

    Cool, I've done line-by-line already. PS mode left as a single piece though.

    I'm going to deploy update (with artifact wildcards too) in a couple of hours.

  8. 8 Posted by Adam Ralph on 31 Jan, 2014 11:22 PM

    Adam Ralph's Avatar

    Fantastic. Getting late here now but I'll try and give it a whirl over the weekend. Thanks!

  9. Support Staff 9 Posted by Feodor Fitsner on 31 Jan, 2014 11:23 PM

    Feodor Fitsner's Avatar

    Thank you for your time! Have a nice weekend!

  10. Support Staff 10 Posted by Feodor Fitsner on 01 Feb, 2014 02:26 AM

    Feodor Fitsner's Avatar

    Adam,

    I've deployed update with line-by-line script execution.

    Give it another try when you have a chance and let me know if you find anything else.

    -Feodor

  11. 11 Posted by Adam Ralph on 01 Feb, 2014 09:21 AM

    Adam Ralph's Avatar

    I just tried it and it worked perfectly! See https://ci-beta.appveyor.com/project/adamralph/scriptcs-nancy/build/11

    Thanks very much for fixing this so quickly.

  12. Adam Ralph closed this discussion on 01 Feb, 2014 09:21 AM.

  13. Feodor Fitsner re-opened this discussion on 01 Feb, 2014 10:21 PM

  14. Support Staff 12 Posted by Feodor Fitsner on 01 Feb, 2014 10:21 PM

    Feodor Fitsner's Avatar

    Great, thanks for the update!

  15. Adam Ralph closed this discussion on 11 Jan, 2015 04:04 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

21 Aug, 2019 11:06 PM
21 Aug, 2019 02:08 PM
21 Aug, 2019 01:37 PM
21 Aug, 2019 10:21 AM
21 Aug, 2019 09:10 AM

 

21 Aug, 2019 05:56 AM
21 Aug, 2019 03:08 AM
20 Aug, 2019 11:33 PM
20 Aug, 2019 08:07 PM
20 Aug, 2019 05:50 PM
20 Aug, 2019 12:35 PM