-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
81 lines (75 loc) · 1.99 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
stages:
- test
- analysis
- build
- deploy
variables:
MYSQL_DATABASE: [PROJECT]
MYSQL_ROOT_PASSWORD: pass
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
unittest:
image: registry.2le.net/2le/2le:base-build-php8
stage: test
services:
- name: registry.2le.net/2le/[PROJECT]:dbtest
alias: dbtest
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.2le.net
- composer install
- make test
artifacts:
paths:
- phpunit.coverage.xml
- phpunit.report.xml
only:
- main
- merge_requests
- devops
sonarqube:
stage: analysis
image: sonarsource/sonar-scanner-cli
variables:
SONAR_URL: https://sonar.2le.net
SONAR_ANALYSIS_MODE: publish
script:
- sonar-scanner
only:
- main
- merge_requests
- devops
build-master:
stage: build
image: registry.2le.net/2le/2le:base-build
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- make build
only:
- main
deploy-master:
image: registry.2le.net/2le/2le:base-deploy
stage: deploy
variables:
GIT_STRATEGY: none
only:
- main
script:
- ssh -o StrictHostKeyChecking=no [email protected] "cd /data/docker/[PROJECT]/; ./up.sh $CI_REGISTRY_IMAGE:latest symfony "
#build-tags:
# stage: build
# image: registry.2le.net/2le/2le:base-build
# script:
# - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# - docker build -t $IMAGE_TAG --build-arg app_version=$CI_COMMIT_TAG .
# - docker push $IMAGE_TAG
# only:
# - tags
#
#deploy-tags:
# image: registry.2le.net/2le/2le:base-deploy
# stage: deploy
# variables:
# GIT_STRATEGY: none
# only:
# - tags
# script:
# - ssh -o StrictHostKeyChecking=no [email protected] "cd /data/docker/[PROJECT]-prod/; ./up.sh $IMAGE_TAG symfony "