-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
163 lines (153 loc) · 6.45 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
stages:
- build
- test
- deploy
workflow:
rules:
# If merge request exists: Run as (detached) merge request pipeline (- if: $CI_PIPELINE_SOURCE == "merge_request_event")
# Never run normal pipeline when merge request exists / never run both (- if: $CI_OPEN_MERGE_REQUESTS)
# Otherwise: Run as normal pipeline (- when: always)
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_OPEN_MERGE_REQUESTS
when: never
- when: always
# variables:
# # https://docs.cypress.io/guides/continuous-integration/gitlab-ci#Install-Job
# # https://github.com/cypress-io/cypress/issues/2821#issuecomment-444109124
# # https://github.com/cypress-io/cypress/issues/1281#issuecomment-404823001
# npm_config_cache: '$CI_PROJECT_DIR/.npm'
# CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress'
# Cache isn't useful for parallel descendant jobs, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1151
# cache:
# key: ${CI_COMMIT_REF_SLUG}
# paths:
# - $npm_config_cache
build:
stage: build
interruptible: true
image: srv-docker-1:5000/schicksoftware/dotnet8.0-jre17-nodejs20.0:latest
tags: [ linux, docker ]
script:
- Build/scripts/reportserver.build.ps1
rules:
# If merge request exists: Run as (detached) merge request pipeline (- if: $CI_PIPELINE_SOURCE == "merge_request_event")
# If tag is pushed: Run as normal pipeline (- if: $CI_COMMIT_TAG)
# On unprotected branch: Enable manual start of normal pipeline (- if: $CI_COMMIT_REF_PROTECTED == "false")
# Otherwise run always (merge / fast forward / ...) (- when: always)
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_REF_PROTECTED == "false"
when: manual
- when: always
test:
stage: test
needs: []
interruptible: true
image: srv-docker-1:5000/schicksoftware/dotnet8.0-jre17-nodejs20.0:latest
tags: [ linux, docker ]
script:
- Build/scripts/reportserver.test.ps1
rules:
# If merge request exists: Don't allow to fail (- if: $CI_PIPELINE_SOURCE == "merge_request_event")
# If tag is pushed: Run as normal pipeline (- if: $CI_COMMIT_TAG)
# On unprotected branch: Allow fail (- if: $CI_COMMIT_REF_PROTECTED == "false")
# Else: Don't allow to fail (default)
# On unprotected branch: Enable manual start (- if: $CI_COMMIT_REF_PROTECTED == "false")
# Otherwise run always (merge / fast forward / ...) (- when: always)
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
allow_failure: false
- if: $CI_COMMIT_TAG
allow_failure: false
- if: $CI_COMMIT_REF_PROTECTED == "false"
allow_failure: false
when: manual
- when: always
artifacts:
name: "test-results"
paths:
- ./**/TestResults/*.trx
- ./**/TestResults/*.html
- ./FS.TimeTracking.UI.Angular/cypress/screenshots
- ./FS.TimeTracking.UI.Angular/cypress/videos
expire_in: 1 week
when: always
deploy_docker:
stage: deploy
interruptible: true
image: docker:20.10.12
services:
- name: docker:20.10.12-dind
command: [ "--insecure-registry=srv-docker-1:5000" ]
variables:
DOCKER_TLS_CERTDIR: "/certs"
tags: [ linux, docker-in-docker ]
script:
- docker info
- docker build -t timetracking.reportserver --build-arg CI_PROJECT_NAME="$CI_PROJECT_NAME" --build-arg CI_COMMIT_REF_NAME="$CI_COMMIT_REF_NAME" -f Build/docker/reportserver.docker .
- docker tag timetracking.reportserver srv-docker-1:5000/schicksoftware/timetracking.reportserver:$CI_COMMIT_TAG
- docker tag timetracking.reportserver srv-docker-1:5000/schicksoftware/timetracking.reportserver:latest
- docker push srv-docker-1:5000/schicksoftware/timetracking.reportserver:$CI_COMMIT_TAG
- docker push srv-docker-1:5000/schicksoftware/timetracking.reportserver:latest
rules:
# Run only when version-tag is pushed (- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/)
- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/
deploy_windows:
stage: deploy
image: srv-docker-1:5000/schicksoftware/dotnet8.0-jre17-nodejs20.0:latest
tags: [ linux, docker ]
interruptible: true
script:
- Build/scripts/reportserver.publish.ps1 -version "$env:CI_COMMIT_REF_NAME" -runtime win-x64 -publshFolder "$env:CI_PROJECT_NAME-$env:CI_COMMIT_REF_NAME"
rules:
# Run only when version-tag is pushed (- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/)
- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-win-x64"
paths:
- "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
expire_in: 1 month
deploy_linux:
stage: deploy
interruptible: true
image: srv-docker-1:5000/schicksoftware/dotnet8.0-jre17-nodejs20.0:latest
tags: [ linux, docker ]
script:
- Build/scripts/reportserver.publish.ps1 -version "$env:CI_COMMIT_REF_NAME" -runtime linux-x64 -publshFolder "$env:CI_PROJECT_NAME-$env:CI_COMMIT_REF_NAME"
rules:
# Run only when version-tag is pushed (- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/)
- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-linux-x64"
paths:
- "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
expire_in: 1 month
deploy_private_client:
stage: deploy
interruptible: true
image: srv-docker-1:5000/schicksoftware/dotnet8.0-jre17-nodejs20.0:latest
tags: [ linux, docker ]
script:
- Build/scripts/reportserver_client.publish.ps1 -version "$env:CI_COMMIT_REF_NAME" -publshFolder "$env:CI_PROJECT_NAME-$env:CI_COMMIT_REF_NAME" -nugetUrl "https://nuget.home.f-schick.de" -apiKey "$env:NUGET_PRIVATE_API_KEY"
rules:
# Run only when version-tag is pushed (- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/)
- if: $CI_COMMIT_TAG =~ /^\d+\.\d+.*$/
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-client"
paths:
- "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
expire_in: 1 month
deploy_public_client:
stage: deploy
interruptible: true
image: srv-docker-1:5000/schicksoftware/dotnet8.0-jre17-nodejs20.0:latest
tags: [ linux, docker ]
script:
- Build/scripts/reportserver_client.publish.ps1 -version "$env:CI_COMMIT_REF_NAME" -publshFolder "$env:CI_PROJECT_NAME-$env:CI_COMMIT_REF_NAME" -nugetUrl "https://api.nuget.org/v3/index.json" -apiKey "$env:NUGET_PUBLIC_API_KEY"
rules:
# Run only when non alpha/beta version-tag is pushed (- if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/)
- if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-client"
paths:
- "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
expire_in: 1 month