Added cleaning tmp AND moved ci build trigger to plus branch

Cache our builds based on branches - part 1
This commit is contained in:
Deon George 2018-01-29 13:36:35 +11:00
parent a072f6ed51
commit e31d600b09
2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,8 @@ stages:
- build - build
variables: variables:
VERSION: 7.1-fpm-plus BRANCH: plus
VERSION: 7.1-fpm-${BRANCH}
CACHETAG: build CACHETAG: build
DOCKER_REGISTRY: registry.leenooks.net DOCKER_REGISTRY: registry.leenooks.net
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375 DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
@ -34,8 +35,8 @@ build:
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true - docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}-${BRANCH}
tags: tags:
- docker - docker
only: only:
- master - plus

View File

@ -8,7 +8,7 @@ RUN echo "deb http://deb.debian.org/debian jessie non-free" >> /etc/apt/sources.
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/freetype2 --with-jpeg-dir=/usr/include/ \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/freetype2 --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) pdo_mysql bz2 gettext sockets gmp gd pcntl snmp exif \ && docker-php-ext-install -j$(nproc) pdo_mysql bz2 gettext sockets gmp gd pcntl snmp exif \
&& pecl install imagick && docker-php-ext-enable imagick \ && pecl install imagick && docker-php-ext-enable imagick \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/* /tmp/*
RUN apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/lists/* \ RUN apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/lists/* \
&& useradd -c "Hosting Admin User" -u 1000 -g users -G www-data -d /var/www/html -M lamp && useradd -c "Hosting Admin User" -u 1000 -g users -G www-data -d /var/www/html -M lamp