Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis: switch to focal distribution for builds #1960

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 24 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@

language: php
os: linux
dist: bionic
dist: focal

# -----------------------------------------------------------------------------
# Environment setup and test scripts execution
#

services:
- postgresql
- mysql
- postgresql
addons:
postgresql: "12"
apt:
packages:
- postgresql-12
- postgresql-client-12

install:
- composer install
Expand All @@ -39,27 +45,27 @@ branches:
- /master-[0-9.]+/

php:
- 8.3
# - 8.3
- 8.2
- 8.1
- 8.0
- 7.4
# - 8.1
# - 8.0
# - 7.4

env:
- DB=mysql
- DB=pgsql
# - DB=mysql
- DB=pgsql PGPORT=5433 PGUSER=travis

jobs:
include:
# Add a specific build for Documentation
- name: Documentation
env: DOCBOOK=1
# Using Ruby as it's preinstalled and we don't need PHP to build docs
language: ruby
addons:
apt:
packages:
- publican
# include:
# # Add a specific build for Documentation
# - name: Documentation
# env: DOCBOOK=1
# # Using Ruby as it's preinstalled and we don't need PHP to build docs
# language: ruby
# addons:
# apt:
# packages:
# - publican

allow_failures: []

Expand Down
24 changes: 24 additions & 0 deletions build/test_db_connect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
include 'vendor/autoload.php';

$f_db_type = getenv( 'DB_TYPE' );
$f_hostname = getenv( 'DB_HOSTNAME' );
$f_admin_username = getenv( 'DB_USER' );
$f_admin_password = (string)getenv( 'DB_PASSWORD' );

[$host, $port] = explode(':', $f_hostname);
$str = sprintf("host='%s' port='%d' user='%s' password='%s'",
addcslashes($host, "'\\"),
$port,
addcslashes($f_admin_username, "'\\"),
addcslashes($f_admin_password, "'\\")
);
var_dump($str, pg_connect( $str ) );

$g_db = ADONewConnection( $f_db_type );
$g_db->debug = true;
$t_result = $g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password );

var_dump($t_result);
echo $g_db->ErrorMsg();
die(1);
14 changes: 10 additions & 4 deletions build/travis_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ step "Create database $MANTIS_DB_NAME"
case $DB in

mysql)
DB_HOSTNAME=$HOSTNAME
DB_TYPE='mysqli'
DB_USER='root'
DB_PASSWORD=''
Expand All @@ -81,12 +82,17 @@ case $DB in
;;

pgsql)
DB_TYPE='pgsql'
DB_USER='postgres'
DB_PASSWORD=''
export DB_HOSTNAME=$HOSTNAME:$PGPORT
export DB_TYPE='pgsql'
export DB_USER=$PGUSER
export DB_PASSWORD=''
DB_CMD="psql -U $DB_USER -c"
DB_CMD_SCHEMA="-d $MANTIS_DB_NAME"

echo "DEBUG $PGUSER"
pwd
php ./build/test_db_connect.php

# Wait a bit to make sure Postgres has started
sleep 5
$DB_CMD "$SQL_CREATE_DB"
Expand Down Expand Up @@ -122,7 +128,7 @@ step "MantisBT Installation"
declare -A query=(
[install]=2
[db_type]=$DB_TYPE
[hostname]=$HOSTNAME
[hostname]=$DB_HOSTNAME
[database_name]=$MANTIS_DB_NAME
[db_username]=$DB_USER
[db_password]=$DB_PASSWORD
Expand Down