Commit a791f33c authored by Manuel Munz's avatar Manuel Munz
Browse files

Initial commit

parents
Pipeline #21423 failed with stage
in 19 seconds
image: docker:latest
services:
- name: docker:dind
command: ["--experimental"]
stages:
- build
build:
stage: build
only:
refs:
- master
script:
- /bin/sh build.sh
FROM php:7.3-cli
MAINTAINER Manuel Munz munz@team23.de
# Install required system packages
RUN apt-get update && \
apt-get -y install --no-install-recommends \
git \
zlib1g-dev \
libssl-dev \
libzip-dev \
nano \
unzip && \
apt-get -y autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install php extensions
#RUN docker-php-ext-install \
# bcmath \
# zip
# Install pecl extensions
RUN pecl install xdebug-2.7.1 && \
docker-php-ext-enable xdebug
# Configure php
RUN echo "date.timezone = \"Europe/Berlin\"" >> /usr/local/etc/php/php.ini
# Install composer
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer \
--install-dir=/usr/local/bin
RUN composer global require --prefer-dist --no-interaction --optimize-autoloader --apcu-autoloader \
"hirak/prestissimo"
# Prepare application
RUN mkdir /opt/codeception
WORKDIR /opt/codeception
RUN composer init --no-interaction --name team23/codeception --require codeception/codeception:^3 \
&& composer config repositories.markupvalidator vcs https://github.com/mmunz/codeception-markup-validator.git \
&& composer config minimum-stability dev \
&& composer config prefer-stable true \
&& composer require kolyunya/codeception-markup-validator:dev-codeception_3_support captbaritone/mailcatcher-codeception-module \
&& composer install --no-interaction --optimize-autoloader --apcu-autoloader
ENV PATH /opt/codeception/vendor/bin:${PATH}
RUN rm -rf /tmp/*
WORKDIR /app
CMD tail -f /dev/null
# codeception
codeception container based on php 7.3 and cpodeception 3 with some useful modules enabled:
- codeception-markup-validator
- captbaritone/mailcatcher-codeception-module
## Supported tags and respective Dockerfile links
* `3.0-php7.3`: [Dockerfile](3.0-php7.3/Dockerfile)
* `latest`: see `3.0-php7.3`
#!/bin/bash
# Configuration
VERSIONS="3.0-php7.3"
LATEST_VERSION="3.0-php7.3"
# Let's do it
set -o errexit
set -o pipefail
if [ -z "$CI_REGISTRY" ]
then # outside gitlab ci runner
docker login docker.team23.de
BUILD_PROJECT_NAME=$( basename $( pwd ) )
BUILD_IMAGE_BASE="docker.team23.de/docker/$BUILD_PROJECT_NAME"
else # inside gitlab ci runner
docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
BUILD_IMAGE_BASE="$CI_REGISTRY/$CI_PROJECT_PATH"
fi
for VERSION in $VERSIONS
do
# Build Image
docker build --squash --pull -t "$BUILD_IMAGE_BASE:$VERSION" "$VERSION"
# only CI should be allowed push images
[ -n "$CI_REGISTRY" ] && docker push "$BUILD_IMAGE_BASE:$VERSION"
done
# Build latest image
docker build --squash --pull -t "$BUILD_IMAGE_BASE:latest" "$LATEST_VERSION"
[ -n "$CI_REGISTRY" ] && docker push "$BUILD_IMAGE_BASE:latest"
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