habux
habux

Reputation: 67

Jenkins build job fails while installing a package

I'm working on a Jenkinsfile that should be able to perform e2e-Tests with protractor befor deployment. So i need to install several packages for a chrome-headless installation (Yes, I've checked multiple pages with different ideas to get this headless thing started, but non of them worked for me, so I ended up here eith the question). When I start the build on Jenkins I get this output:

[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.

It is not an error but for some reason the script execution stops at this point. I think it's because apt-get or dpkg want my agreement to install. I tried to force the installation but it didn't work out.

Here the part of my 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'

Can someone help me out with this problem? If you need more information ask. Thx

Upvotes: 2

Views: 2290

Answers (1)

habux
habux

Reputation: 67

Use -y

Found out that apt-get install -y [package] is solving my problem. Reading man pages helps a lot I found out...

Upvotes: 1

Related Questions