-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
164 lines (148 loc) · 3.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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
stages:
- lint
- build
- test
- release
before_script:
- export DOTNET_TAG="$CI_BUILD_REF_NAME"
## LINT
cspell-docs:
image: dbogatov/docker-images:cspell-latest
stage: lint
script:
- ./build.sh -f test-docs-spell-ci
tags:
- docker
## BUILD
build-docs:
image: dbogatov/docker-images:mk-docs-latest
stage: build
script:
- ./build.sh -f build-docs
artifacts:
expire_in: 90 min
paths:
- documentation/out/
tags:
- docker
build-ping:
image: golang:alpine
stage: build
script:
- apk --update add bash
- ./build.sh -f build-ping-server
artifacts:
expire_in: 90 min
paths:
- ping/bin/*
tags:
- docker
build-app:
image: dbogatov/docker-images:net-core-latest
stage: build
script:
- export ASPNETCORE_ENVIRONMENT="Production"
- printf "{\"Version\":{\"GitHash\":\"%s\"}}" $CI_BUILD_REF > src/version.json
- ./build.sh
artifacts:
expire_in: 90 min
paths:
- src/web/bin/
- src/daemons/bin/
tags:
- docker
## TEST
unit-test-app:
stage: test
image: microsoft/dotnet:2.0.3-sdk
dependencies: []
script:
- printf "{\"Version\":{\"GitHash\":\"%s\"}}" $CI_BUILD_REF > src/version.json
- cd test
- dotnet restore
- dotnet build
- ./test.sh | tee /dev/stderr | grep 'Test Run Successful.'
tags:
- docker
tidy-app:
stage: test
image: dbogatov/docker-images:net-core-latest
dependencies:
- build-app
before_script:
- export ASPNETCORE_ENVIRONMENT="Staging"
- cd src/web/bin/release/netcoreapp2.0/publish/
- dotnet web.dll > /dev/null &
- sleep 15
script:
- curl -Ls http://localhost | tidy -e
- curl -Ls http://localhost/home/metric/CpuLoad/the-source | tidy -e
tags:
- docker
blc-app:
stage: test
image: dbogatov/docker-images:net-core-latest
dependencies:
- build-app
before_script:
- export ASPNETCORE_ENVIRONMENT="Staging"
- cd src/web/bin/release/netcoreapp2.0/publish/
- dotnet web.dll > /dev/null &
- sleep 15
script:
- blc --filter-level 3 --input http://localhost -rog --exclude "*linkedin.*" --exclude "*authenticate*" | tee /dev/stderr | grep 'Finished!' | tail -1 | grep '0 broken.'
tags:
- docker
blc-docs:
stage: test
image: dbogatov/docker-images:blc-latest
dependencies:
- build-docs
before_script:
- http-server documentation/out/ -p 80 > /dev/null &
- sleep 5
script:
- blc --filter-level 3 --input http://localhost -rog --exclude "*linkedin.*" --exclude "*doxygen.*" --exclude "*status.dbogatov.org*" --exclude "*github.com*" --exclude "*git.dbogatov.org*" --exclude "*favicon*" --exclude "*fonts.gstatic.com*" | tee /dev/stderr | grep 'Finished!' | tail -1 | grep '0 broken.'
tags:
- docker
## RELEASE
release-app-docs:
stage: release
dependencies:
- build-app
- build-docs
- build-ping
script:
- ./build.sh -f build-docker-images
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- ./build.sh -f push-docker-images
- ./build.sh -f build-compose-files
artifacts:
paths:
- docker-compose.yml
- appsettings.production.yml
tags:
- shell
release-debian:
stage: release
dependencies: []
image: dbogatov/docker-images:debian-latest
script:
- ./build.sh -f build-debian-package
artifacts:
paths:
- debian/build/*
tags:
- docker
release-deployment:
stage: release
dependencies: []
image: dbogatov/docker-images:alpine-extras-latest
script:
- ./build.sh -f build-deployment
artifacts:
paths:
- deployment/config.yaml
expire_in: 50 yrs
tags:
- docker