-
Notifications
You must be signed in to change notification settings - Fork 85
/
.gitlab-ci.yml
65 lines (56 loc) · 1.84 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
stages:
- build
- test
- aceptation
- clean
- release
before_script:
- export RELEASE=${CI_BUILD_REF_NAME}
- cd etc/infrastructure
build:
stage: build
script:
- mkdir -p context-${RELEASE}/build
- docker pull jorge07/alpine-php:7.1
- docker pull jorge07/alpine-php:7.1-dev
- docker-compose -p ${RELEASE} -f build/docker-compose.yml pull
- docker-compose -p ${RELEASE} -f build/docker-compose.yml build
- docker-compose -p ${RELEASE} -f build/docker-compose.yml up -d
- docker exec sf-build-${RELEASE} ant build
test-mess-detector:
stage: test
script:
- docker exec ${RELEASE}_fpm_1 ./vendor/bin/phpmd src text cleancode, codesize, controversial, design, naming, unusedcode
allow_failure: true
test-deptrac:
stage: test
script:
- docker exec ${RELEASE}_fpm_1 wget http://get.sensiolabs.de/deptrac.phar
- docker exec ${RELEASE}_fpm_1 php deptrac.phar analyze --formatter-graphviz=0
test-coverage:
stage: test
script:
- docker exec ${RELEASE}_fpm_1 ant unit-and-functional
aceptation:
stage: aceptation
script:
- docker exec ${RELEASE}_fpm_1 ant acceptation
clean-build:
stage: clean
script:
- docker-compose -p ${RELEASE} -f build/docker-compose.yml down --volumes
when: always
release:tags:
stage: release
only:
- tags
script:
- docker build -t sf-build-${RELEASE} -f build/fpm/Dockerfile ../../
- docker run -d --name building-${RELEASE} sf-build-${RELEASE}
- docker cp building-${RELEASE}:/app context-${RELEASE}/build/
- docker rm -f building-${RELEASE}
- cp -R prod/fpm context-${RELEASE}/build/fpm
- cp -R prod/nginx context-${RELEASE}/build/nginx
- docker login -u jorge07 -p ${GITLAB_PASSWORD} registry.gitlab.com
- docker-compose -f prod/docker-compose.build.yml build
- docker-compose -f prod/docker-compose.build.yml push