-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
145 lines (132 loc) · 3.21 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
include:
- project: 'iserv-internal/git/ci'
file: '/iserv-app.yml'
workflow:
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
variables:
CI_ISERV_PACKAGE_UPLOAD: "false"
- !reference [.workflow, rules]
variables:
CI_ISERV_TRANSLATIONS_ENABLE: "false"
CI_ISERV_WEB_ROOT: './'
stages:
- prepare
- extract
- update
- fetch
- prebuild
- build
- compile
- check
- package
- test
- lint
- upload
- release
- distribute
- distribute-ci
composer:
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//
when: always
- !reference [.composer, rules]
composer dev:
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//
when: always
- !reference [.composer, rules]
phpstan:
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//
when: always
- !reference [.phpstan, rules]
psalm:
rules:
- if: ($CI_COMMIT_BRANCH || $CI_MERGE_REQUEST_ID || ($CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//))
when: always
php-cs-fixer:
rules:
- if: ($CI_COMMIT_BRANCH || $CI_MERGE_REQUEST_ID || ($CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//))
when: always
Phar:
stage: build
image: !reference [.PHP Image, image]
before_script:
- env
- git utimes
- cd "${CI_ISERV_WEB_ROOT:-.}"
script:
- iservmake phar
needs:
- composer
artifacts:
paths:
- cotor
- cotor.phar
expire_in: 1 week
rules:
- if: $RENOVE_ENABLE == "true"
when: never
- if: ($CI_COMMIT_BRANCH || $CI_MERGE_REQUEST_ID || ($CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//))
when: always
tags:
- docker
Phar Upload:
stage: upload
image: curlimages/curl:latest
before_script:
- env
- cd "${CI_ISERV_WEB_ROOT:-.}"
script:
- 'curl -f --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file cotor.phar "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/cotor.phar"'
needs:
- Phar
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//
tags:
- docker
Prepare Release:
stage: build
image: $CI_REGISTRY/iserv/internal-dev/slim:master
before_script:
- env
- cd "${CI_ISERV_WEB_ROOT:-.}"
script:
- echo "RELEASE_DESCRIPTION=$(echo "$CI_COMMIT_TAG_MESSAGE" | sed "/-----BEGIN PGP SIGNATURE-----/,/-----END PGP SIGNATURE-----/d")" | sed ':a;N;$!ba;s/\n/<br>/g' >> variables.env
needs: []
artifacts:
reports:
dotenv: variables.env
expire_in: 1 week
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//
tags:
- docker
Release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
before_script:
- env
- cd "${CI_ISERV_WEB_ROOT:-.}"
script:
- echo "Running release job"
needs:
- Phar Upload
- job: Prepare Release
artifacts: true
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^iserv\//
release:
tag_name: '$CI_COMMIT_TAG'
description: '$RELEASE_DESCRIPTION'
assets:
links:
- name: "cotor.phar"
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/cotor.phar"
tags:
- docker
Package:
needs:
- !reference [.Package, needs]
- Phar