首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装包时Jenkins构建作业失败

安装包时Jenkins构建作业失败
EN

Stack Overflow用户
提问于 2017-10-27 09:20:16
回答 1查看 1.6K关注 0票数 2

我正在编写一个Jenkinsfile,它应该能够在部署之前使用量角器执行e2e-test。所以我需要为一个无头安装安装几个包(是的,我已经检查了多个页面,有不同的想法来启动这个无头程序,但是它们都不是为我工作的,所以我最终提出了这个问题)。当我在Jenkins上开始构建时,我得到了以下输出:

代码语言:javascript
复制
[ature_ChromeHeadlessJenkins-
I3N4DKAF3MHS72RV35MYVEHTF7OCMJ2VQKG54JMW2L7IQHOYN66A] Running shell script
+ apt-get install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 
libxss1 fonts-liberation libappindicator1 xdg-utils
Reading package lists...
Building dependency tree...
Reading state information...
libgtk2.0-0 is already the newest version (2.24.31-2).
libgtk2.0-0 set to manually installed.
libxpm4 is already the newest version (1:3.5.12-1).
libxpm4 set to manually installed.
libxrender1 is already the newest version (1:0.9.10-1).
libxrender1 set to manually installed.
The following additional packages will be installed:
cpp cpp-6 gconf-service gconf2-common libauthen-sasl-perl libdbus-glib-1-2
libdbusmenu-glib4 libdbusmenu-gtk4 libencode-locale-perl
libfile-basedir-perl libfile-desktopentry-perl libfile-listing-perl
libfile-mimeinfo-perl libfont-afm-perl libhtml-form-perl libhtml-format-perl
libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
libhttp-message-perl libhttp-negotiate-perl libindicator7 libio-html-perl
libio-socket-ssl-perl libipc-system-simple-perl libisl15
liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl libmpc3
libmpfr4 libnet-dbus-perl libnet-http-perl libnet-smtp-ssl-perl
libnet-ssleay-perl libtext-iconv-perl libtie-ixhash-perl libtimedate-perl
liburi-perl libwww-perl libwww-robotrules-perl libx11-protocol-perl
libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl
perl-openssl-defaults x11-xserver-utils
Suggested packages:
cpp-doc gcc-6-locales libdigest-hmac-perl libgssapi-perl libdata-dump-perl
libcrypt-ssleay-perl libauthen-ntlm-perl libunicode-map8-perl
libunicode-string-perl xml-twig-tools nickle cairo-5c xorg-docs-core
gvfs-bin
The following NEW packages will be installed:
cpp cpp-6 fonts-liberation gconf-service gconf2-common libappindicator1
libauthen-sasl-perl libdbus-glib-1-2 libdbusmenu-glib4 libdbusmenu-gtk4
libencode-locale-perl libfile-basedir-perl libfile-desktopentry-perl
libfile-listing-perl libfile-mimeinfo-perl libfont-afm-perl libgconf-2-4
libhtml-form-perl libhtml-format-perl libhtml-parser-perl
libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
libhttp-daemon-perl libhttp-date-perl libhttp-message-perl
libhttp-negotiate-perl libindicator7 libio-html-perl libio-socket-ssl-perl
libipc-system-simple-perl libisl15 liblwp-mediatypes-perl
liblwp-protocol-https-perl libmailtools-perl libmpc3 libmpfr4
libnet-dbus-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl
libtext-iconv-perl libtie-ixhash-perl libtimedate-perl liburi-perl
libwww-perl libwww-robotrules-perl libx11-protocol-perl libxml-parser-perl
libxml-twig-perl libxml-xpathengine-perl libxss1 perl-openssl-defaults
x11-xserver-utils xdg-utils
The following packages will be upgraded:
libnss3
1 upgraded, 55 newly installed, 0 to remove and 1 not upgraded.
Need to get 14.9 MB of archives.
After this operation, 45.3 MB of additional disk space will be used.

这不是一个错误,但由于某种原因,脚本执行在此时停止。我想是因为apt-get或dpkg想让我的协议安装。我试图强行安装,但没有成功。

在这里,我的Jenkinsfile的部分:

代码语言:javascript
复制
sh 'webdriver-manager update'

sh 'apt-get update'
sh 'apt-get install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 '
sh 'apt-get install -f libxss1 fonts-liberation libappindicator1 xdg-utils' //FAILS HERE
sh 'wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb'
sh 'dpkg -i --force-all google-chrome-stable_current_amd64.deb'
sh 'apt-get install -f'

sh 'apt-get install xvfb gtk2-engines-pixbuf'
sh 'apt-get install xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable'
sh 'apt-get install imagemagick x11-apps dbus-x11'
sh 'Xvfb -ac :99 -screen 0 1280x1024x16 & export DISPLAY=:99'
sh 'webdriver-manager start /dev/null 2>&1'

有人能帮我解决这个问题吗?如果你需要更多的信息,问问。Thx

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-10-27 11:49:17

使用-y

发现apt-get install -y [package]正在解决我的问题。阅读手册页对我发现了很多帮助..。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46971636

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档