Commit 9b19ef07 authored by Manuel Christlieb's avatar Manuel Christlieb
Browse files

parallel build

parent f7c9954c
Pipeline #14404 canceled with stage
in 4 minutes and 2 seconds
......@@ -6,10 +6,26 @@ services:
stages:
- build
build:
build56:
stage: build
only:
refs:
- master
script:
- /bin/sh build.sh
- /bin/sh build/ci/build.sh 5.6
build71:
stage: build
only:
refs:
- master
script:
- /bin/sh build/ci/build.sh 7.1
build72:
stage: build
only:
refs:
- master
script:
- /bin/sh build/ci/build.sh 7.2 latest
FROM php:7.0-fpm-stretch
# Add php.ini for more dev-specific PHP configuration
COPY php.ini /usr/local/etc/php/
# Add composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install xdebug
RUN apt-get update && \
apt-get install -y autoconf dpkg dpkg-dev file g++ gcc make pkgconf re2c && \
pecl channel-update pecl.php.net && \
pecl install xdebug && \
rm -rf /var/lib/apt/lists/*
# TODO: Remove packages again, currently apt will bail out with:
# "WARNING: The following essential packages will be removed.
# This should NOT be done unless you know exactly what you are doing!"
#apt-get remove -y autoconf dpkg dpkg-dev file g++ gcc make pkgconf re2c && \
COPY team23-docker-php-enable-xdebug.sh /usr/local/bin/
# Install Magento-specific extensions
RUN apt-get update && \
apt-get install -y git mariadb-client openssh-client libfreetype6 libpng16-16 libjpeg62-turbo gettext libmcrypt4 libxslt1.1 libicu57 && \
apt-get install -y libfreetype6-dev libpng-dev libjpeg62-turbo-dev libmcrypt-dev libxslt1-dev libicu-dev && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) gd bcmath soap gettext mcrypt mysqli pdo_mysql opcache xsl zip intl calendar && \
apt-get remove -y libfreetype6-dev libpng-dev libjpeg62-turbo-dev libmcrypt-dev libxslt1-dev libicu-dev && \
rm -rf /var/lib/apt/lists/*
# Enable our own entrypoint which can be used to install/enable xdebug using env variables
COPY team23-docker-php-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["team23-docker-php-entrypoint.sh"]
# This has to be here again as ENTRYPOINT seems to reset CMD
CMD ["php-fpm"]
# Finally switch to our standard workdir
WORKDIR /app/web/
#!/bin/bash
# Configuration
VERSIONS="5.6 7.0 7.1 7.2"
LATEST_VERSION="7.2"
# Let's do it
set -o errexit
set -o pipefail
VERSION="${1:-}"
ADDITIONAL="${2:-}"
if [ -z "$VERSION" ]
then
echo "Error: No version supplied"
echo "Usage: $0 <version> [additional]"
exit 1
fi
if [ -z "$CI_REGISTRY" ]
then # outside gitlab ci runner
docker login docker.team23.de
......@@ -20,21 +22,22 @@ else # inside gitlab ci runner
BUILD_IMAGE_BASE="$CI_REGISTRY/$CI_PROJECT_PATH"
fi
for VERSION in $VERSIONS
do
# Copy shared files
cp -rp shared/*.sh "$VERSION/"
cp -rp shared/php.ini "$VERSION/"
# Copy version specific versions of shared scripts
if [ -d shared/$VERSION ]
then
cp -rp shared/$VERSION/*.sh "$VERSION/"
fi
# Build Image
docker build --pull -t "$BUILD_IMAGE_BASE:$VERSION" "$VERSION"
docker push "$BUILD_IMAGE_BASE:$VERSION"
done
# Copy shared files
cp -rp shared/*.sh "$VERSION/"
cp -rp shared/php.ini "$VERSION/"
# Copy version specific versions of shared scripts
if [ -d shared/$VERSION ]
then
cp -rp shared/$VERSION/*.sh "$VERSION/"
fi
# Build Image
docker build --pull -t "$BUILD_IMAGE_BASE:$VERSION" "$VERSION"
docker push "$BUILD_IMAGE_BASE:$VERSION"
# Build latest image
docker build --pull -t "$BUILD_IMAGE_BASE:latest" "$LATEST_VERSION"
docker push "$BUILD_IMAGE_BASE:latest"
if [ ! -z "$ADDITIONAL" ]
then
# Build additional image (usually latest)
docker build --pull -t "$BUILD_IMAGE_BASE:$ADDITIONAL" "$VERSION"
docker push "$BUILD_IMAGE_BASE:$ADDITIONAL"
fi
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