From 0c972ed7f6a123099a7f9108604f042fbc5c9d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Uzna=C5=84ski?= Date: Fri, 24 Jul 2020 11:53:07 +0200 Subject: [PATCH] [TASK] Add base gitlab ci composer build (#80) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Łukasz Uznański --- .gitlab-ci.yml | 25 +++++++++++++++++++++++++ .gitlab/build/docker_install.sh | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 .gitlab/build/docker_install.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2482bd8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +--- +stages: + - build + +default: + image: php:7.4 + before_script: + - bash .gitlab/build/docker_install.sh > /dev/null + +build-composer-dependencies: + stage: build + variables: + COMPOSER_CACHE_DIR: '.composer' + script: + - COMPOSER_CACHE_DIR=.composer + composer install --prefer-dist --no-progress --optimize-autoloader + artifacts: + when: on_success + expire_in: 2 weeks + paths: + - .Build + cache: + paths: + - .composer + - .Build diff --git a/.gitlab/build/docker_install.sh b/.gitlab/build/docker_install.sh new file mode 100644 index 0000000..bb7ddcf --- /dev/null +++ b/.gitlab/build/docker_install.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +[[ ! -e /.dockerenv ]] && exit 0 + +set -xe + +apt-get update -yqq +apt-get install git libzip-dev unzip -yqq + +php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin/ --filename=composer +chmod +x /usr/local/bin/composer + +docker-php-ext-install zip \ No newline at end of file