我正在开发一个Jenkins文件,它应该能够使用量角器进行e2e-Tests部署。所以我需要安装几个用于chrome无头安装的软件包(是的,我已经检查了多个不同想法的页面以启动这个无头的东西,但是它们没有为我工作,所以我最终在这里提出了问题)。当我开始在Jenkins上构建时,我得到了这个输出:
[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的一部分:
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
答案 0 :(得分:1)
使用-y
发现apt-get install -y [package]
正在解决我的问题。阅读手册有助于我发现很多......