Commit f2839c5d authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] infra-353 kickstart php 7.3 build

parent b315710d
......@@ -9,5 +9,6 @@ build_php56
build_php70
build_php71
build_php72
build_php73
build_bamboo
.idea
\ No newline at end of file
Copyright (c) 2013-2015 Phusion Holding B.V.
Copyright (c) 2016 Morton Jonuschat
Copyright (c) 2018 Christian Kuhn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -55,6 +55,13 @@ PATCHLEVEL_PHP72=4
FULLVERSION_PHP72=$(MAJOR_PHP72).$(MINOR_PHP72).$(PATCHLEVEL_PHP72)
SHORTVERSION_PHP72=$(MAJOR_PHP72).$(MINOR_PHP72)
NAME_PHP73 = typo3gmbh/php73
MAJOR_PHP73=3
MINOR_PHP73=0
PATCHLEVEL_PHP73=0
FULLVERSION_PHP73=$(MAJOR_PHP73).$(MINOR_PHP73).$(PATCHLEVEL_PHP73)
SHORTVERSION_PHP73=$(MAJOR_PHP73).$(MINOR_PHP73)
NAME_BAMBOO = typo3gmbh/bamboo-remote-agent
MAJOR_BAMBOO=1
......@@ -76,6 +83,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
build_php70 \
build_php71 \
build_php72 \
build_php73 \
build_bamboo \
release \
release_baseimage \
......@@ -86,6 +94,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
release_php70 \
release_php71 \
release_php72 \
release_php73 \
release_bamboo \
clean \
clean_baseimage \
......@@ -96,6 +105,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
clean_php70 \
clean_php71 \
clean_php72 \
clean_php73 \
clean_bamboo \
clean_images \
clean_images_baseimage \
......@@ -106,6 +116,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
clean_images_php70 \
clean_images_php71 \
clean_images_php72 \
clean_images_php73 \
clean_images_bamboo
......@@ -125,7 +136,8 @@ build_php: \
build_php56 \
build_php70 \
build_php71 \
build_php72
build_php72 \
build_php73
release: \
release_baseimage \
......@@ -139,7 +151,8 @@ release_php: \
release_php56 \
release_php70 \
release_php71 \
release_php72
release_php72 \
release_php73
clean: \
clean_baseimage \
......@@ -150,6 +163,7 @@ clean: \
clean_php70 \
clean_php71 \
clean_php72 \
clean_php73 \
clean_bamboo
......@@ -162,6 +176,7 @@ clean_images: \
clean_images_php70 \
clean_images_php71 \
clean_images_php72 \
clean_images_php73 \
clean_images_bamboo
......@@ -358,6 +373,30 @@ clean_images_php72:
docker rmi $(NAME_PHP72):$(FULLVERSION_PHP72) || true
build_php73: build_baseimage
rm -rf build_php73
cp -pR php73 build_php73
docker build -t $(NAME_PHP73):$(FULLVERSION_PHP73) build_php73
docker tag $(NAME_PHP73):$(FULLVERSION_PHP73) $(NAME_PHP73):$(SHORTVERSION_PHP73)
release_php73:
@if ! docker images $(NAME_PHP73) | awk '{ print $$2 }' | grep -q -F $(FULLVERSION_PHP73); then \
echo "$(NAME_PHP73) version $(FULLVERSION_PHP73) is not yet built. Please run 'make build'"; false; \
fi
docker tag $(NAME_PHP73):$(FULLVERSION_PHP73) $(NAME_PHP73):latest
docker push $(NAME_PHP73):latest
docker push $(NAME_PHP73):$(FULLVERSION_PHP73)
docker push $(NAME_PHP73):$(SHORTVERSION_PHP73)
clean_php73:
rm -rf build_php73
clean_images_php73:
docker rmi $(NAME_PHP73):latest || true
docker rmi $(NAME_PHP73):$(SHORTVERSION_PHP73) || true
docker rmi $(NAME_PHP73):$(FULLVERSION_PHP73) || true
build_bamboo: build_baseimage
rm -rf build_bamboo
......
......@@ -46,9 +46,6 @@ Users can use these images to execute unit, functional, acceptance and JS tests
identical to the core testing infrastructure. Note that some core tests need additional containers that
run a database or selenium with chrome.
Simple usage example, executing accepance tests on a fresh core clone:
### bamboo-remote-agent
......
FROM typo3gmbh/baseimage:3.0
MAINTAINER TYPO3 GmbH <info@typo3.com>
ADD . /pd_build
RUN /pd_build/enable_repos.sh && \
/pd_build/nodejs.sh && \
/pd_build/php.sh && \
/pd_build/finalize.sh
export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive
function minimal_apt_get_install()
{
if [[ ! -e /var/lib/apt/lists/lock ]]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
}
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
apt-get update
# ondrej with a php 7.3
echo deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main > /etc/apt/sources.list.d/php.list
# ondrej key - the recv-keys part takes a bit of time, so it's faster to receive multiple keys at once.
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys \
E5267A6C \
#
# for msodbcsql17 mssql-tools sqlserv
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
apt-get update
apt-get -y dist-upgrade
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
apt-get clean
apt-get -y autoremove
rm -rf \
/var/lib/apt/lists/* \
/root/.npm/ \
/tmp/* \
/var/tmp/* \
/usr/local/src/* \
#
rm -rf /pd_build
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
# Install Node.js and some packages to successfully compile stuff
minimal_apt_get_install npm nodejs make g++
# And have yarn
npm install -g yarn
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
minimal_apt_get_install \
make \
php7.3 \
php7.3-apcu \
php7.3-bcmath \
php7.3-bz2 \
php7.3-cli \
php7.3-common \
php7.3-curl \
php7.3-dev \
php7.3-gd \
php7.3-gmp \
php7.3-imap \
php7.3-intl \
php7.3-json \
php7.3-mbstring \
php7.3-mysql \
php7.3-opcache \
php7.3-pgsql \
php7.3-pspell \
php7.3-readline \
php7.3-recode \
php7.3-soap \
php7.3-sqlite3 \
php7.3-xdebug \
php7.3-xml \
php7.3-xmlrpc \
php7.3-xsl \
php7.3-zip \
php-pear \
php-redis \
php-memcached \
re2c \
graphicsmagick \
imagemagick \
zip \
unzip \
sqlite3 \
#
# Disable opcache on php 7.3 since that triggers segfaults 'zend_mm_heap corrupted' with vfsStream 1.6.4 (currently)
# Note: Still true?
echo "opcache.enable_cli=0" >> /etc/php/7.3/cli/conf.d/10-opcache.ini
# Enable phar writing
sed -i s/';phar.readonly = On'/'phar.readonly = Off'/ /etc/php/7.3/cli/php.ini
# Restrict cli based php.ini settings for php -S web server to have sane values in acceptance tests
sed -i s/'memory_limit = -1'/'memory_limit = 2G'/ /etc/php/7.3/cli/php.ini
sed -i s/'max_execution_time = 30'/'max_execution_time = 240'/ /etc/php/7.3/cli/php.ini
sed -i s/'; max_input_vars = 1000'/'max_input_vars = 1500'/ /etc/php/7.3/cli/php.ini
echo "xdebug.max_nesting_level = 400" >> /etc/php/7.3/mods-available/xdebug.ini
# Enable apc on cli for unit tests
echo "apc.enable_cli=1" >> /etc/php/7.3/mods-available/apcu.ini
echo "apc.slam_defense=0" >> /etc/php/7.3/mods-available/apcu.ini
# mssql driver
ACCEPT_EULA=Y minimal_apt_get_install \
msodbcsql17 \
mssql-tools \
unixodbc-dev \
#
pecl install sqlsrv
pecl install pdo_sqlsrv
echo extension=sqlsrv.so >> /etc/php/7.3/mods-available/sqlsrv.ini
echo extension=pdo_sqlsrv.so >> /etc/php/7.3/mods-available/pdo_sqlsrv.ini
phpenmod sqlsrv
phpenmod pdo_sqlsrv
# Prepare an additional php.ini file that does *NOT* include xdebug
# can be used with: php -n -c /etc/php/cli-no-xdebug/php.ini
mkdir /etc/php/cli-no-xdebug/
php -i | \
grep "\.ini" | \
grep -o -e '\(/[A-Za-z0-9._-]\+\)\+\.ini' | \
grep -v xdebug | \
xargs awk 'FNR==1{print ""}1' | \
grep -v '^;' | \
grep -v '^$' > /etc/php/cli-no-xdebug/php.ini
# Install composer
curl -sSL https://getcomposer.org/download/1.6.5/composer.phar -o /usr/bin/composer
chmod +x /usr/bin/composer
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment