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

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

parents 6141cd85 927b6e58
.DS_Store
.vagrant
php55_image
php56_image
php70_image
php71_image
.idea
\ No newline at end of file
NAME = typo3gmbh/bamboo-remote-agent
MAJOR=1
MINOR=0
PATCHLEVEL=1
FULLVERSION=$(MAJOR).$(MINOR).$(PATCHLEVEL)
SHORTVERSION=$(MAJOR).$(MINOR)
.PHONY: \
all \
build \
release \
clean \
clean_images
all: build
build:
rm -rf php55_image
cp -pR image php55_image
echo system.imageVersion=$(FULLVERSION) >> php55_image/config/bamboo/bamboo-capabilities.properties
docker build -t $(NAME)-php55:$(FULLVERSION) --rm php55_image
release:
@if ! docker images $(NAME)-php55 | awk '{ print $$2 }' | grep -q -F $(FULLVERSION); then echo "$(NAME)-php55 version $(FULLVERSION) is not yet built. Please run 'make build'"; false; fi
docker tag $(NAME)-php55:$(FULLVERSION) $(NAME)-php55:$(SHORTVERSION)
docker tag $(NAME)-php55:$(FULLVERSION) $(NAME)-php55:latest
docker push $(NAME)-php55:latest
docker push $(NAME)-php55:$(FULLVERSION)
docker push $(NAME)-php55:$(SHORTVERSION)
clean:
rm -rf php55_image
clean_images:
docker rmi $(NAME)-php55:latest $(NAME)-php55:$(SHORTVERSION) $(NAME)-php55:$(FULLVERSION) || true
\ No newline at end of file
# Docker base images for TYPO3 Bamboo Agent
FROM typo3gmbh/baseimage:1.0
MAINTAINER TYPO3 GmbH <info@typo3.com>
ADD . /pd_build
RUN /pd_build/install.sh
CMD ["/sbin/my_init"]
EXPOSE 80 443
#!/bin/bash
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 https://bamboo.typo3.com/agentServer/agentInstaller/atlassian-bamboo-agent-installer-5.12.2.1.jar -o /tmp/bamboo-installer.jar
/usr/bin/java -Dbamboo.home=/srv/bamboo-agent-home -jar /tmp/bamboo-installer.jar https://bamboo.typo3.com/agentServer install
chown -R bamboo:bamboo /srv/bamboo-agent-home
rm -f /tmp/bamboo-installer.jar
## Configure properties
cp -a /pd_build/config/bamboo/bamboo-capabilities.properties /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
fi
apt-get install -y --no-install-recommends "$@"
}
GRANT ALL ON `func\_%`.* to funcu@'%' IDENTIFIED BY 'funcp' WITH GRANT OPTION;
FLUSH PRIVILEGES;
[mysqld]
init-file=/etc/mysql/grants.sql
server {
listen 127.0.0.1:8000;
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: http://trac.nginx.org/nginx/ticket/321
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/nginx.pid;
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)
[acceptance-tests]
user = bamboo
group = bamboo
listen = /run/php/$pool-fpm.sock
listen.owner = www-data
listen.group = 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
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
## NGINX Stable Releases
echo deb http://ppa.launchpad.net/nginx/stable/ubuntu xenial main > /etc/apt/sources.list.d/nginx-stable.list
## ondrej with php 5.5
echo deb http://ppa.launchpad.net/ondrej/php/ubuntu 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 keyserver.ubuntu.com --recv-keys \
C300EE8C \
E5267A6C \
#
## NodeSource's Node.js repository
curl --fail -sL https://deb.nodesource.com/setup_4.x | bash -
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
# remove a ton of packages needed for compilation of apcu and apcu-bc
# commented until acpu is working again
#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.0-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
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
/pd_build/enable_repos.sh
/pd_build/prepare.sh
/pd_build/bamboo-agent.sh
/pd_build/mysql.sh
/pd_build/nginx.sh
/pd_build/redis-server.sh
/pd_build/memcached.sh
/pd_build/nodejs.sh
/pd_build/php.sh
/pd_build/finalize.sh
#!/bin/bash
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
#!/bin/bash
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
#!/bin/bash
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
#!/bin/bash
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