Install script does not respect multiple commands
E.g. I want to:
- update the gem system
- 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.
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
Support Staff 1 Posted by Feodor Fitsner on 31 Jan, 2014 06:32 PM
I will look into this!
2 Posted by Adam Ralph on 31 Jan, 2014 06:34 PM
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 :/.
Support Staff 3 Posted by Feodor Fitsner on 31 Jan, 2014 06:37 PM
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.
Support Staff 4 Posted by Feodor Fitsner on 31 Jan, 2014 08:39 PM
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 firstgem
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?
Support Staff 5 Posted by Feodor Fitsner on 31 Jan, 2014 09:12 PM
It was UI bug in console rendering function combining multiple lines to a single one.
6 Posted by Adam Ralph on 31 Jan, 2014 10:45 PM
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.
Support Staff 7 Posted by Feodor Fitsner on 31 Jan, 2014 10:54 PM
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 Posted by Adam Ralph on 31 Jan, 2014 11:22 PM
Fantastic. Getting late here now but I'll try and give it a whirl over the weekend. Thanks!
Support Staff 9 Posted by Feodor Fitsner on 31 Jan, 2014 11:23 PM
Thank you for your time! Have a nice weekend!
Support Staff 10 Posted by Feodor Fitsner on 01 Feb, 2014 02:26 AM
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 Posted by Adam Ralph on 01 Feb, 2014 09:21 AM
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.
Adam Ralph closed this discussion on 01 Feb, 2014 09:21 AM.
Feodor Fitsner re-opened this discussion on 01 Feb, 2014 10:21 PM
Support Staff 12 Posted by Feodor Fitsner on 01 Feb, 2014 10:21 PM
Great, thanks for the update!
Adam Ralph closed this discussion on 11 Jan, 2015 04:04 PM.