@@ -18,10 +18,8 @@ pipeline {
18
18
BUILD_VERSION = getVersion()
19
19
MAJOR_VERSION = ' 2'
20
20
BRANCH_LOWER = " ${ BRANCH_NAME.toLowerCase().replaceAll('\\\\', '-').replaceAll('/', '-').replaceAll('\\.', '-')} "
21
- COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} "
22
- COMPOSE_FILE = ' docker/docker-compose.ci.yml'
21
+ BUILDX_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} "
23
22
COMPOSE_INTERACTIVE_NO_CLI = 1
24
- BUILDX_NAME = " ${ COMPOSE_PROJECT_NAME} "
25
23
}
26
24
stages {
27
25
stage(' Environment' ) {
@@ -92,81 +90,63 @@ pipeline {
92
90
sh ' yarn install'
93
91
sh ' yarn build'
94
92
}
95
- dir(path : ' docs/.vuepress/dist' ) {
96
- sh ' tar -czf ../../docs.tgz *'
97
- }
98
- archiveArtifacts(artifacts : ' docs/docs.tgz' , allowEmptyArchive : false )
99
93
}
100
94
}
101
- stage(' Cypress' ) {
102
- steps {
103
- // Creating will also create the network prior to
104
- // using it in parallel stages below and mitigating
105
- // a race condition.
106
- sh ' docker-compose build cypress-sqlite'
107
- sh ' docker-compose build cypress-mysql'
108
- sh ' docker-compose create cypress-sqlite'
109
- sh ' docker-compose create cypress-mysql'
110
- }
95
+ }
96
+ }
97
+ stage(' Test Sqlite' ) {
98
+ environment {
99
+ COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} _sqlite"
100
+ COMPOSE_FILE = ' docker/docker-compose.ci.yml:docker/docker-compose.ci.sqlite.yml'
101
+ }
102
+ when {
103
+ not {
104
+ equals expected : ' UNSTABLE' , actual : currentBuild. result
105
+ }
106
+ }
107
+ steps {
108
+ sh ' rm -rf ./test/results/junit/*'
109
+ sh ' ./scripts/ci/fulltest-cypress'
110
+ }
111
+ post {
112
+ always {
113
+ // Dumps to analyze later
114
+ sh ' mkdir -p debug/sqlite'
115
+ sh ' docker logs $(docker-compose ps --all -q fullstack) > debug/sqlite/docker_fullstack.log 2>&1'
116
+ sh ' docker logs $(docker-compose ps --all -q stepca) > debug/sqlite/docker_stepca.log 2>&1'
117
+ sh ' docker logs $(docker-compose ps --all -q pdns) > debug/sqlite/docker_pdns.log 2>&1'
118
+ sh ' docker logs $(docker-compose ps --all -q pdns-db) > debug/sqlite/docker_pdns-db.log 2>&1'
119
+ sh ' docker logs $(docker-compose ps --all -q dnsrouter) > debug/sqlite/docker_dnsrouter.log 2>&1'
120
+ junit ' test/results/junit/*'
121
+ sh ' docker-compose down --remove-orphans --volumes -t 30 || true'
111
122
}
112
123
}
113
124
}
114
- stage(' Integration Tests' ) {
115
- parallel {
116
- stage(' Sqlite' ) {
117
- steps {
118
- // Bring up a stack
119
- sh ' docker-compose up -d fullstack-sqlite'
120
- sh ' ./scripts/wait-healthy $(docker-compose ps --all -q fullstack-sqlite) 120'
121
- // Stop and Start it, as this will test it's ability to restart with existing data
122
- sh ' docker-compose stop fullstack-sqlite'
123
- sh ' docker-compose start fullstack-sqlite'
124
- sh ' ./scripts/wait-healthy $(docker-compose ps --all -q fullstack-sqlite) 120'
125
-
126
- // Run tests
127
- sh ' rm -rf test/results-sqlite'
128
- sh ' docker-compose up cypress-sqlite'
129
- // Get results
130
- sh ' docker cp -L "$(docker-compose ps --all -q cypress-sqlite):/test/results" test/results-sqlite'
131
- }
132
- post {
133
- always {
134
- // Dumps to analyze later
135
- sh ' mkdir -p debug/sqlite'
136
- sh ' docker-compose logs fullstack-sqlite > debug/sqlite/docker_fullstack_sqlite.log'
137
- // Cypress videos and screenshot artifacts
138
- dir(path : ' test/results-sqlite' ) {
139
- archiveArtifacts allowEmptyArchive : true , artifacts : ' **/*' , excludes : ' **/*.xml'
140
- }
141
- junit ' test/results-sqlite/junit/*'
142
- }
143
- }
125
+ stage(' Test Mysql' ) {
126
+ environment {
127
+ COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} _mysql"
128
+ COMPOSE_FILE = ' docker/docker-compose.ci.yml:docker/docker-compose.ci.mysql.yml'
129
+ }
130
+ when {
131
+ not {
132
+ equals expected : ' UNSTABLE' , actual : currentBuild. result
144
133
}
145
- stage(' Mysql' ) {
146
- steps {
147
- // Bring up a stack
148
- sh ' docker-compose up -d fullstack-mysql'
149
- sh ' ./scripts/wait-healthy $(docker-compose ps --all -q fullstack-mysql) 120'
150
-
151
- // Run tests
152
- sh ' rm -rf test/results-mysql'
153
- sh ' docker-compose up cypress-mysql'
154
- // Get results
155
- sh ' docker cp -L "$(docker-compose ps --all -q cypress-mysql):/test/results" test/results-mysql'
156
- }
157
- post {
158
- always {
159
- // Dumps to analyze later
160
- sh ' mkdir -p debug/mysql'
161
- sh ' docker-compose logs fullstack-mysql > debug/mysql/docker_fullstack_mysql.log'
162
- sh ' docker-compose logs db > debug/mysql/docker_db.log'
163
- // Cypress videos and screenshot artifacts
164
- dir(path : ' test/results-mysql' ) {
165
- archiveArtifacts allowEmptyArchive : true , artifacts : ' **/*' , excludes : ' **/*.xml'
166
- }
167
- junit ' test/results-mysql/junit/*'
168
- }
169
- }
134
+ }
135
+ steps {
136
+ sh ' rm -rf ./test/results/junit/*'
137
+ sh ' ./scripts/ci/fulltest-cypress'
138
+ }
139
+ post {
140
+ always {
141
+ // Dumps to analyze later
142
+ sh ' mkdir -p debug/mysql'
143
+ sh ' docker logs $(docker-compose ps --all -q fullstack) > debug/mysql/docker_fullstack.log 2>&1'
144
+ sh ' docker logs $(docker-compose ps --all -q stepca) > debug/mysql/docker_stepca.log 2>&1'
145
+ sh ' docker logs $(docker-compose ps --all -q pdns) > debug/mysql/docker_pdns.log 2>&1'
146
+ sh ' docker logs $(docker-compose ps --all -q pdns-db) > debug/mysql/docker_pdns-db.log 2>&1'
147
+ sh ' docker logs $(docker-compose ps --all -q dnsrouter) > debug/mysql/docker_dnsrouter.log 2>&1'
148
+ junit ' test/results/junit/*'
149
+ sh ' docker-compose down --remove-orphans --volumes -t 30 || true'
170
150
}
171
151
}
172
152
}
@@ -185,30 +165,17 @@ pipeline {
185
165
}
186
166
stage(' Docs / Comment' ) {
187
167
parallel {
188
- stage(' Master Docs' ) {
189
- when {
190
- allOf {
191
- branch ' master'
192
- not {
193
- equals expected : ' UNSTABLE' , actual : currentBuild. result
194
- }
195
- }
196
- }
197
- steps {
198
- npmDocsReleaseMaster()
199
- }
200
- }
201
- stage(' Develop Docs' ) {
168
+ stage(' Docs Job' ) {
202
169
when {
203
170
allOf {
204
- branch ' develop'
171
+ branch pattern : " ^( develop|master) \$ " , comparator : " REGEXP "
205
172
not {
206
173
equals expected : ' UNSTABLE' , actual : currentBuild. result
207
174
}
208
175
}
209
176
}
210
177
steps {
211
- npmDocsReleaseDevelop()
178
+ build wait : false , job : ' nginx-proxy-manager-docs ' , parameters : [string( name : ' docs_branch ' , value : " $B RANCH_NAME " )]
212
179
}
213
180
}
214
181
stage(' PR Comment' ) {
@@ -231,9 +198,8 @@ pipeline {
231
198
}
232
199
post {
233
200
always {
234
- sh ' docker-compose down --remove-orphans --volumes -t 30'
235
201
sh ' echo Reverting ownership'
236
- sh ' docker run --rm -v $(pwd):/data jc21/ci-tools chown -R $(id -u):$(id -g) /data'
202
+ sh ' docker run --rm -v " $(pwd):/data" jc21/ci-tools chown -R " $(id -u):$(id -g)" /data'
237
203
}
238
204
success {
239
205
juxtapose event : ' success'
0 commit comments