ubuntu-make
ubuntu-make copied to clipboard
No CLI parameter to specify installation path directly from command line (unable to use ubuntu-make in chef)
Does anyone have a reliable workaround to automatically accept the default installation path when prompted? Specifically for ide eclipse-jee.
I tried using "yes", but then it doesn't set the default installation path at all and installs it into the void. "Expect" also gets confused, what I need is to set the installation path directly:
umake ide eclipse-jee --path "/home/vagrant/.local/share/umake/ide/eclipse-jee"
This would make umake useful in automatic configuration management tools (e.g. chef).
Hey @TomaszDom. That's indeed a good idea! I have only thought about "set the path manually if you don't want to be prompted for the default paths about it". I think this is quite easy to achieve.
I'll accept any good PR with tests for that (I don't think I have time to add this feature myself for now, maybe in few weeks). Opening it up for contributions for now, as people can set themselve in chef or such via umake ide eclipse-jee ~/.local/share/umake/ide/eclipse-jee for instance (with the repetition of terms though)
@TomaszDom I agree, additionally with https://github.com/ubuntu/ubuntu-make/issues/79 it makes ubuntu-make quite useless :(
Here's my workaround recipe in chef:
execute "add-ubuntu-make-ppa" do
command "sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make --y"
action :run
not_if do ::File.exist?('/etc/apt/sources.list.d/ubuntu-desktop-ubuntu-ubuntu-make-xenial.list') end
end
execute "update" do
command "sudo apt-get -y -qq update"
action :run
end
package ['ubuntu-make', 'expect']
script 'install-eclipse' do
interpreter 'expect'
cwd '/home/vagrant'
code <<-EOH
spawn runuser -u vagrant sudo umake ide eclipse-jee
set timeout -1
expect {
-regexp "Choose installation path:" {
exp_send "\025/home/vagrant/.local/share/umake/ide/eclipse-jee\r"
exp_continue
}
eof
}
EOH
not_if do ::File.exist?('/home/vagrant/.local/share/umake/ide/eclipse-jee/eclipse') end
end
@TomaszDom Tell me if I'm wrong What you would need is an option to automatically accept the default folder?
My use case does not go beyond accepting the default folder as you can see from my workaround from two months ago. It's an ugly solution to a simple problem, but it works.
I was trying to figure out how to fix this in umake directly. Would a command to automatically accept the default path without having to pass it as a parameter help?
On Tue 18 Apr 2017, 21:01 TomaszDom, [email protected] wrote:
My use case does not go beyond accepting the default folder as you can see from my workaround from two months ago. It's an ugly solution to a simple problem, but it works.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ubuntu/ubuntu-make/issues/403#issuecomment-294947306, or mute the thread https://github.com/notifications/unsubscribe-auth/AGyLRRWyWa-D-dKJ0SmEj8qn73Unnggbks5rxQihgaJpZM4Lwjv- .
Definitely a switch or something like that would help, e.g. "-y" or "--y", I'd then be able to get rid of that ugly code from production and make it a little more robust (although I haven't had any issues with it so far).
If anyone needs a custom installation path in automated environments, they will figure out a workaround like I did or adapt the code found here.
@TomaszDom I have another workaround that might be simpler, try yes '\n' | sudo umake ide eclipse-jee although an option in ubuntu-make would definitely be better
@hgarfer, do you think that #449 could be a solution for you? There are a few issues with it, but if you want to test it, then let me know.
@LyzardKing that would work for me, will try to make some time to test it, thanks!
Great! Let me know when you test it.
On 10 Nov 2017 11:38, "Holger" [email protected] wrote:
@LyzardKing https://github.com/lyzardking that would work for me, will try to make some time to test it, thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ubuntu/ubuntu-make/issues/403#issuecomment-343438762, or mute the thread https://github.com/notifications/unsubscribe-auth/AGyLRdClvrqpJMlrBE9q1fBCKCVY01qeks5s1Ce1gaJpZM4Lwjv- .