I am trying run a specific version of couchdb
on travis-ci
I do this by following the offical apt-get
instructions from couchdb
Part of the installation is a prompt for what to do with an old configuration file. See the following:
Installing new version of config file /etc/logrotate.d/couchdb ...
Configuration file `/etc/couchdb/local.ini'
==> Deleted (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** local.ini (Y/I/N/O/D/Z) [default=N] ?
This causes travis-ci
to hang and the build to fail.
Here is the travis-ci
i have tried with and without the sudo rm
and a handful of otherthings.
language: python
php:
- 2.7
install: "pip install -r requirements.txt"
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sudo apt-get install python-software-properties -y
- sudo add-apt-repository ppa:couchdb/stable -y
- sudo apt-get update -yq
- sudo apt-get remove couchdb couchdb-bin couchdb-common -yf
- sudo rm /etc/couchdb/local.ini
- sudo apt-get install -Vy couchdb
- sudo service couchdb start
before_script:
- curl -X PUT localhost:5984/njb_tests
script: python run-tests.py
You can see the different things i have tried by looking at my commit history:
https://github.com/Victory/notice-javascript-bugs/commits/master/.travis.yml
Hello my Frind its quite easy I believe this command will do the trick
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install couchdb
export DEBIAN_FRONTEND=noninteractive
apt-get -o Dpkg::Options::="--force-confnew" install -y
on shell or in code do
export DEBIAN_FRONTEND=noninteractive
then
sudo apt-get -q -y install couchdb
It will assume “yes” to everything (and do it quietly)
you need to watch Debconf is the name of the tool. That page should help you get going with everything you want to know. debconf man page
you get asked for package maintainer or a password you should set on apt-get do here a simple example from a server that asks to set password on apt-get install
To keep your existing password, leave this blank.
Password for SYSDBA:
then you run it with this script below to do the input
#!/usr/bin/expect
spawn dpkg-reconfigure firebird2.5-superclassic -freadline
expect "Enable Firebird server?"
send "Y\r"
expect "Password for SYSDBA:"
send "newpwd\r"
# done
expect eof
Working example for your case is
- /usr/bin/expect 'spawn sudo apt-get install -Vy couchdb \n expect "*** local.ini (Y/I/N/O/D/Z) [default=N] ?" \n send "Y\r"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With