Как установить rvm от имени пользователя jenkins?

1803
CaymanEss

Я следую этим шагам, чтобы настроить сервер Jenkins на экземпляр Ubuntu EC2.

Все хорошо, пока я не доберусь до этого шага:

Как установить rvm от имени пользователя jenkins?

Как видите (в конце вывода) меня спрашивают пароль для пользователя jenkins. Насколько я понимаю, пользователь jenkins не является интерактивным, поэтому у него нет нормального пароля. Я ошибаюсь?

ubuntu@ip-xxx-xxx-xxx-xxx:~$ sudo su jenkins jenkins@ip-xxx-xxx-xxx-xxx:/home/ubuntu$ curl -L https://get.rvm.io | bash -s stable --ruby % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 184 100 184 0 0 257 0 --:--:-- --:--:-- --:--:-- 345 100 20572 100 20572 0 0 21776 0 --:--:-- --:--:-- --:--:-- 21776 Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz  Upgrading the RVM installation in /var/lib/jenkins/.rvm/ RVM PATH line found in /var/lib/jenkins/.bashrc /var/lib/jenkins/.zshrc. RVM sourcing line found in /var/lib/jenkins/.bash_profile /var/lib/jenkins/.zlogin. Upgrade of RVM in /var/lib/jenkins/.rvm/ is complete.  # Jenkins-ci, # # Thank you for using RVM! # We sincerely hope that RVM helps to make your life easier and more enjoyable!!! # # ~Wayne, Michal & team.  In case of problems: http://rvm.io/help and https://twitter.com/rvm_io  Upgrade Notes:  * No new notes to display.   rvm 1.24.7 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]  Searching for binary rubies, this might take some time. Found remote file https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-2.0.0-p353.tar.bz2 Checking requirements for ubuntu. Installing requirements for ubuntu. jenkins password required for 'apt-get --quiet --yes update': 
2
Как вы в итоге решили это? Ashitaka 9 лет назад 0

3 ответа на вопрос

3
Austin Lin

Looks like the rvm installer is trying to run apt-get to install missing dependencies, we can fix that by pre installing them. Try running this as root:

sudo apt-get install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev git-core 

And now try running your install command again as the Jenkins user.

Буду признателен за то, что вы получили этот список зависимостей, так что я могу проверить, является ли он все еще точным. Спасибо! sampablokuper 8 лет назад 0
1
Braiam

The password here asked is for sudo, this allows the installation script to execute apt-get. Either you should execute it yourself with a user that has root permissions or temporally add the jerkins user to the sudoers and allow it to execute apt-get or give it a temporal password. Those are the 3 ways I see.

0
Rokujolady

Другое решение состоит в том, чтобы загрузить рубин вручную и вставить его в папку архива домашней папки Jenkins .rvm. Rvm смотрит туда, прежде чем пытаться скачать рубин. Насколько я знаю, вы можете только su для пользователя Jenkins, и вам, вероятно, не стоит пытаться обойти это.

Похожие вопросы