#!/bin/bash BACKEND="mariadb" # install mysql stuff export DEBIAN_FRONTEND=noninteractive case "$BACKEND" in "mysql") sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password rootpw" sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password rootpw" sudo aptitude install -y mysql-server libmysqlclient-dev;; "mariadb") sudo debconf-set-selections <<< "mariadb-server mysql-server/root_password password rootpw" sudo debconf-set-selections <<< "mariadb-server mysql-server/root_password_again password rootpw" sudo aptitude install -y mariadb-server libmariadb-client-lgpl-dev-compat sudo ln -s /usr/bin/mariadb_config /usr/bin/mysql_config;; esac # install perl and Dist::Zilla sudo aptitude install -y curl git vim build-essential libssl-dev \curl -L https://install.perlbrew.pl | bash echo "source ~/perl5/perlbrew/etc/bashrc" >> ~/.bashrc source ~/perl5/perlbrew/etc/bashrc perlbrew install perl-5.20.3 perlbrew switch 5.20.3 curl -L https://cpanmin.us | perl - App::cpanminus cpanm Dist::Zilla # build and test Minion::Backend::mysql git clone https://github.com/preaction/Minion-Backend-mysql.git cd Minion-Backend-mysql/ dzil authordeps --missing | cpanm dzil listdeps --author --missing | cpanm perl -e 'use Test::mysqld; $mysqld = Test::mysqld->new(my_cnf => { "skip-networking" => ""}); $dbh = DBI->connect($mysqld->dsn(dbname => "test")); print $dbh->{mysql_clientinfo}, "\n"; print $dbh->{mysql_clientversion}, "\n"; print $dbh->{mysql_serverversion}, "\n";' dzil test