forked from shopware/development
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
90 lines (79 loc) · 2.15 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
variables:
DOCKER_TLS_CERTDIR: "/certs"
IMAGE_TAG: shopware/development
stages:
- analyze
- unit
- build
cache:
key: "Eternal static key"
paths:
- .composer
- .npm
default:
image: composer:1.10
before_script:
- composer install --ignore-platform-reqs --no-interaction --optimize-autoloader --no-suggest --no-scripts --no-progress
- composer install --ignore-platform-reqs --no-interaction --optimize-autoloader --no-suggest --no-progress --working-dir=dev-ops/analyze
Static Analysis:
stage: analyze
only:
refs:
- merge_requests
- master
script:
- dev-ops/analyze/vendor/bin/ecs check --config easy-coding-standard.php
- dev-ops/analyze/vendor/bin/phpstan analyze --level 8 src
Unit:
image: composer:1.10
stage: unit
only:
refs:
- merge_requests
- master
script:
- vendor/bin/phpunit
--configuration dev-ops/analyze
--log-junit build/artifacts/phpunit.junit.xml
--colors=never
artifacts:
reports:
junit: build/artifacts/phpunit.junit.xml
.base:
image: docker:18.09.7
stage: build
only:
refs:
- master
changes:
- dev-ops/docker/containers/**/*
services:
- name: docker:18.09.7-dind
alias: docker
dependencies:
- Unit
before_script:
- docker login -u $CI_REGISTRY_USER -p "$CI_REGISTRY_PASSWORD"
script:
- sed -ri -e "s!php-apache:7.2!php-apache:$PHP_VERSION!g" dev-ops/docker/containers/app/Dockerfile
- docker build -t $IMAGE_TAG:$PHP_VERSION dev-ops/docker/containers/app
- docker push $IMAGE_TAG:$PHP_VERSION
build:7.2:
extends: .base
variables:
PHP_VERSION: "7.2"
after_script:
- docker tag $IMAGE_TAG:$PHP_VERSION $IMAGE_TAG:latest
- docker push $IMAGE_TAG:latest
build:7.3:
extends: .base
variables:
PHP_VERSION: "7.3"
build:7.4:
extends: .base
variables:
PHP_VERSION: "7.4"
build:8.0:
extends: .base
variables:
PHP_VERSION: "8.0"