forked from systemsdk/docker-nginx-php-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
71 lines (63 loc) · 1.45 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
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
GITLAB_CI: 1
services:
- docker:dind
before_script:
- apk update
- apk upgrade
- apk add --no-cache make bash docker-compose && rm -rf /var/cache/apk/*
stages:
- build
- deploy
.general_scripts: &general_scripts
- make info
build:
stage: build
script:
- make build-test
- make start-test
- docker ps -a
- make wait-for-db
- make drop-migrate
- make seed
- *general_scripts
- make phpunit
- make ecs
- make phpcs
- make phpcpd
- make phpmd
- make phpstan
- make phpinsights
- make stop-test
artifacts:
paths:
- reports/
only:
- merge_requests
- tags
- master
- develop
push_staging_images:
stage: deploy
script:
- make build-staging
# TODO: set necessary image name in docker-compose-staging.yml according to your registry and edit lines bellow
#- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
#- docker-compose -f docker-compose-staging.yml push
only:
- master
- develop
- /^release.*$/
push_prod_images:
stage: deploy
script:
- make build-prod
# TODO: set necessary image name in docker-compose-prod.yml according to your registry and edit lines bellow
#- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
#- docker-compose -f docker-compose-prod.yml push
only:
- master
- /^release.*$/