-
Notifications
You must be signed in to change notification settings - Fork 24
/
.gitlab-ci.yml
57 lines (50 loc) · 1.25 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
stages:
- dependencias
- quality
variables:
COMPOSER_CACHE_DIR: ./composer-cache
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- $COMPOSER_CACHE_DIR
.docker:
# https://gitlab.com/gitlab-com/support-forum/issues/4416#note_199451215
image: docker:18.09.7
services:
- docker:18.09.7-dind
tags:
- docker
variables:
# si tag:kubernetes -> DOCKER_HOST: localhost
# si tag:docker -> NO definir DOCKER_HOST
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: "1"
before_script:
- echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
dockercomposer:
stage: dependencias
extends:
- .docker
script:
- docker pull composer:2.0 || true
- >
docker run --rm
--env COMPOSER_CACHE_DIR
--volume $COMPOSER_CACHE_DIR:$COMPOSER_CACHE_DIR
--volume $PWD:/app
composer:2.0 install --no-scripts --prefer-dist --ignore-platform-reqs
artifacts:
expire_in: 1 month
paths:
- ./vendor/
sonarqube:
stage: quality
tags:
- docker
image: zaquestion/sonarqube-scanner
script:
- sonar-scanner -Dsonar.projectBaseDir=./ -Dsonar.login=$SONAR_TOKEN
allow_failure: true
dependencies: []