Commit 84484a40 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

Merge remote-tracking branch 'otherphpbranches/release/php71' into release/master

parents 8769c622 9950b8b7
NAME = typo3gmbh/bamboo-remote-agent
all \
build \
release \
clean \
all: build
rm -rf php71_image
cp -pR image php71_image
echo system.imageVersion=$(FULLVERSION) >> php71_image/config/bamboo/
docker build -t $(NAME)-php71:$(FULLVERSION) --rm php71_image
@if ! docker images $(NAME)-php71 | awk '{ print $$2 }' | grep -q -F $(FULLVERSION); then echo "$(NAME)-php71 version $(FULLVERSION) is not yet built. Please run 'make build'"; false; fi
docker tag $(NAME)-php71:$(FULLVERSION) $(NAME)-php71:$(SHORTVERSION)
docker tag $(NAME)-php71:$(FULLVERSION) $(NAME)-php71:latest
docker push $(NAME)-php71:latest
docker push $(NAME)-php71:$(FULLVERSION)
docker push $(NAME)-php71:$(SHORTVERSION)
rm -rf php71_image
docker rmi $(NAME)-php71:latest $(NAME)-php71:$(SHORTVERSION) $(NAME)-php71:$(FULLVERSION) || true
# Docker base images for TYPO3 Bamboo Agent
FROM typo3gmbh/baseimage:1.0
ADD . /pd_build
RUN /pd_build/
CMD ["/sbin/my_init"]
EXPOSE 80 443
set -e
source /pd_build/buildconfig
set -x
# Create bamboo work directory
mkdir -p /srv/bamboo-agent-home
chmod 0775 /srv/bamboo-agent-home
chown bamboo:bamboo /srv/bamboo-agent-home
# Install bamboo remote agent
curl -SL --progress-bar -o /tmp/bamboo-installer.jar
/usr/bin/java -Dbamboo.home=/srv/bamboo-agent-home -jar /tmp/bamboo-installer.jar install
chown -R bamboo:bamboo /srv/bamboo-agent-home
rm -f /tmp/bamboo-installer.jar
## Configure properties
cp -a /pd_build/config/bamboo/ /srv/bamboo-agent-home/bin
## Enable agent
cp -a /pd_build/runit/bamboo-agent /etc/service/bamboo-agent
export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive
function minimal_apt_get_install()
if [[ ! -e /var/lib/apt/lists/lock ]]; then
apt-get update
apt-get install -y --no-install-recommends "$@"
GRANT ALL ON `func\_%`.* to funcu@'%' IDENTIFIED BY 'funcp' WITH GRANT OPTION;
server {
server_name localhost;
root /srv/bamboo-agent-home/xml-data/build-dir/CORE-CB-JOB1;
index index.php;
client_max_body_size 64M;
location /typo3/install {
return 307 $scheme://$host/typo3/sysext/install/Start/Install.php;
# Prevent clients from accessing hidden files (starting with a dot)
# This is particularly important if you store .htpasswd files in the site hierarchy
# Access to `/.well-known/` is allowed.
location ~* /\.(?!well-known\/) {
deny all;
# Prevent clients from accessing to backup/config/source files
location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ {
deny all;
# Built-in filename-based cache busting
location ~* (.+)\.(?:\d+)\.(js|css|png|jpg|jpeg|gif)$ {
try_files $uri $1.$2;
location / {
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see:
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https if_not_empty;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass acceptance-tests-fpm;
fastcgi_read_timeout 90;
user www-data;
worker_processes 1;
pid /run/;
daemon off;
events {
worker_connections 768;
# multi_accept on;
http {
# Basic Settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logging Settings
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Gzip Settings
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Virtual Host Configs
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
upstream acceptance-tests-fpm {
server unix:/run/php/acceptance-tests-fpm.sock;
; Start a new pool named 'acceptance-tests'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('acceptance-tests' here)
user = bamboo
group = bamboo
listen = /run/php/$pool-fpm.sock
listen.owner = www-data = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
php_value[memory_limit] = 128M
php_value[max_execution_time] = 240
php_value[variables_order] = EGPCS
php_value[post_max_size] = 32M
php_value[upload_max_filesize] = 32M
php_value[date.timezone] = UTC
php_value[max_input_vars] = 2000
php_value[always_populate_raw_post_data] = -1
set -e
source /pd_build/buildconfig
set -x
## NGINX Stable Releases
echo deb xenial main > /etc/apt/sources.list.d/nginx-stable.list
## ondrej with php 7.1
echo deb xenial main > /etc/apt/sources.list.d/php.list
# The recv-keys part takes a bit of time, so it's faster to receive multiple keys at once.
apt-key adv --keyserver --recv-keys \
C300EE8C \
E5267A6C \
## NodeSource's Node.js repository
curl --fail -sL | bash -
set -e
source /pd_build/buildconfig
set -x
# remove a ton of packages needed for compilation of apcu and apcu-bc
apt-get remove -y --purge autoconf automake autotools-dev binutils cpp cpp-5 file gcc gcc-5 libasan2 libatomic1 libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libgcc-5-dev libisl15 libitm1 liblsan0 libmpc3 libmpfr4 libmpx0 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libquadmath0 libsigsegv2 libssl-dev libtool libtsan0 libubsan0 linux-libc-dev m4 make php7.1-dev shtool zlib1g-dev
apt-get clean
rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/local/src/* \
/usr/include/php/20151012/ext/apcu/ \
rm -rf /pd_build
set -e
source /pd_build/buildconfig
set -x
set -e
source /pd_build/buildconfig
set -x
## Install Redis Server
minimal_apt_get_install \
memcached \
## Enable nginx daemon
cp -a /pd_build/runit/memcached /etc/service/memcached
set -e
source /pd_build/buildconfig
set -x
## Install MariaDB
minimal_apt_get_install \
mariadb-client \
mariadb-server \
## Additional config files
cp /pd_build/config/mysql/*.cnf /etc/mysql/mariadb.conf.d/
## Provide grants.sql
cp /pd_build/config/mysql/grants.sql /etc/mysql/grants.sql
## Enable mysql
cp -a /pd_build/runit/mysql /etc/service/mysql
set -e
source /pd_build/buildconfig
set -x
## Install NGINX
minimal_apt_get_install nginx
## Create document root
mkdir -p /srv/bamboo-agent-home/xml-data/build-dir/CORE-CB-JOB1
chown -R bamboo:bamboo /srv/bamboo-agent-home
## Disable default site
rm -f /etc/nginx/sites-enabled/default
## Configure NGINX
cp /pd_build/config/nginx/nginx.conf /etc/nginx/nginx.conf
cp /pd_build/config/nginx/upstream-acceptance-tests.conf /etc/nginx/conf.d/
cp /pd_build/config/nginx-sites/* /etc/nginx/sites-enabled/
## Enable nginx daemon
cp -a /pd_build/runit/nginx /etc/service/nginx
set -e
source /pd_build/buildconfig
set -x
## Install Node.js
minimal_apt_get_install nodejs
## And update nodejs on global level
npm update -g
\ No newline at end of file
Supports Markdown
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