-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
executable file
·107 lines (93 loc) · 2.47 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
#stages:
#- analysis
#sonarqube:
# stage: analysis
# image: ciricihq/gitlab-sonar-scanner
# variables:
# SONAR_URL: "https://www.krusher.duckdns.org"
# SONAR_PROJECT_VERSION: "$CI_BUILD_ID"
# SONAR_ANALYSIS_MODE: "issues"
# script:
# - /usr/bin/sonar-scanner-run.sh
#sonarqube-reports:
# stage: analysis
# image: ciricihq/gitlab-sonar-scanner
# variables:
# SONAR_URL: "https://www.krusher.duckdns.org"
# SONAR_PROJECT_VERSION: "$CI_BUILD_ID"
# SONAR_ANALYSIS_MODE: "publish"
# script:
# - unset CI_BUILD_REF && /usr/bin/sonar-scanner-run.sh
#krusher:
# stage: analysis
# image: centos:7
# script:
# - yum install git -y
# - mkdir -p /var/www/html
# - cd /usr/src/
# - git clone -b master --depth=1 https://AsteriskTester:[email protected]/asterisktech/KRUSHER.git
# - git clone -b KRUSSAAS --depth=1 https://AsteriskTester:[email protected]/asterisktech/KRUSHER.git
# - cd KRUSHER/sh/
# - sh install.sh
# - php -v
# - mysql -V
# - npm -v
# - node -v
image: docker:git
services:
- docker:dind
stages:
- build
- test
#- release
#- deploy
variables:
CONTAINER_TEST_IMAGE: registry.gitlab.com/asterisktech/krusher/sql-data:$CI_BUILD_REF_NAME
# CONTAINER_RELEASE_IMAGE: registry.example.com/my-group/my-project:latest
DOCKER_DRIVER: overlay
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
build-sql:
stage: build
script:
- docker build -t $CONTAINER_TEST_IMAGE -f sql/Dockerfile sql
- docker push $CONTAINER_TEST_IMAGE
only:
changes:
- sql/Dockerfile
- sql/src/**/*.sql
- sql/src/Code/**/*.sql
- sql/src/Code/_Procedure/**/*.sql
- sql/src/Data/**/*.sql
#- dockerfiles/**/*.sql
#- more_scripts/*.{rb,py,sh}
#Usefull https://habr.com/ru/company/flant/blog/332842/
test-sql:
stage: test
script:
- docker run $CONTAINER_TEST_IMAGE
only:
changes:
- sql/Dockerfile
- sql/src/**/*.sql
- sql/src/Code/**/*.sql
- sql/src/Code/_Procedure/**/*.sql
- sql/src/Data/**/*.sql
#test2:
# stage: test
# script:
# - docker run $CONTAINER_TEST_IMAGE /script/to/run/another/test
#release-image:
# stage: release
# script:
# - docker pull $CONTAINER_TEST_IMAGE
# - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
# - docker push $CONTAINER_RELEASE_IMAGE
# only:
# - master
#deploy:
# stage: deploy
# script:
# - ./deploy.sh
# only:
# - master