This repository has been archived by the owner on Mar 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
/
.gitlab-ci.yml
88 lines (79 loc) · 1.98 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
# GitLab CI configuration
#
# Requirements
# - schmunk42/gitlab-runner >=4.2.0-rc1
before_script:
- export BUILD_PREFIX=buildref${CI_BUILD_REF}$(echo ${CI_BUILD_REF_NAME} | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
- export COMPOSE_PROJECT_NAME=${BUILD_PREFIX}
- export APP_MIGRATION_LOOKUP=@root/tests/codeception/_migrations
- mkdir -p /tmp/${BUILD_PREFIX}
stages:
- build
- test_pre
- test
- report
- deploy
- cleanup
build:
stage: build
script:
- cp .env-dist .env
- make build
test:
stage: test
script:
- export COMPOSE_PROJECT_NAME=${BUILD_PREFIX}${CI_BUILD_NAME}
- set +e
- bash build/scripts/${CI_BUILD_NAME}.sh || EXIT_CODE=$?
- set -e
- cp -r tests/codeception/_output/ /tmp/${BUILD_PREFIX}/${CI_BUILD_NAME}
- exit ${EXIT_CODE}
test-allow_failure:
stage: test_pre
script:
- export COMPOSE_PROJECT_NAME=${BUILD_PREFIX}${CI_BUILD_NAME}
- set +e
- bash build/scripts/${CI_BUILD_NAME}.sh || EXIT_CODE=$?
- set -e
- cp -r tests/codeception/_output/ /tmp/${BUILD_PREFIX}/${CI_BUILD_NAME}
- exit ${EXIT_CODE}
allow_failure: true
only:
- develop
except:
- tags
lint:
stage: test_pre
script:
- make diagnose
- set +e
- bash build/scripts/lint.sh
- set -e
- cp -r tests/_lint/ /tmp/${BUILD_PREFIX}/${CI_BUILD_NAME} || EXIT_CODE=$?
- exit ${EXIT_CODE}
allow_failure: true
report:
stage: report
script:
- cp -r /tmp/${BUILD_PREFIX} $(basename $PWD)-${CI_BUILD_REF}
artifacts:
paths:
- $(basename $PWD)-${CI_BUILD_REF}
when: always
cleanup:
stage: cleanup
script:
- make TEST clean
- export COMPOSE_PROJECT_NAME="${BUILD_PREFIX}test"
- make TEST clean
- export COMPOSE_PROJECT_NAME="${BUILD_PREFIX}test-allow_failure"
- make TEST clean
- rm -rf /tmp/${BUILD_PREFIX}
when: always
deploy:
stage: deploy
script:
- bash build/scripts/deploy.sh
only:
- master
- tags