@@ -28,13 +28,11 @@ pipeline {
28
28
BUILD_VERSION = getVersion()
29
29
BUILD_COMMIT = getCommit()
30
30
MAJOR_VERSION = ' 3'
31
- BRANCH_LOWER = " ${ BRANCH_NAME.toLowerCase().replaceAll('/ ', '-')} "
31
+ BRANCH_LOWER = " ${ BRANCH_NAME.toLowerCase().replaceAll('\\\\', '-').replaceAll('/', '-').replaceAll('\\. ', '-')} "
32
32
COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} "
33
33
COMPOSE_FILE = ' docker/docker-compose.ci.yml'
34
34
COMPOSE_INTERACTIVE_NO_CLI = 1
35
35
BUILDX_NAME = " ${ COMPOSE_PROJECT_NAME} "
36
- DOCS_BUCKET = ' jc21-npm-site-next' // TODO: change to prod when official
37
- DOCS_CDN = ' E2Z0128EHS0Q23' // TODO: same
38
36
}
39
37
stages {
40
38
stage(' Environment' ) {
@@ -68,34 +66,46 @@ pipeline {
68
66
}
69
67
}
70
68
stage(' Build' ) {
71
- steps {
72
- sh ' ./scripts/ci/build-frontend'
73
- sh ' ./scripts/ci/test-backend'
74
- // Temporarily disable building backend binaries
75
- // sh './scripts/ci/build-backend'
76
- // Build the docker image used for testing below
77
- sh ''' docker build --pull --no-cache \\
78
- -t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\
79
- -f docker/Dockerfile \\
80
- --build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
81
- --build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
82
- --build-arg BUILD_VERSION="${BUILD_VERSION}" \\
83
- .
84
- '''
85
- }
86
- post {
87
- success {
88
- junit ' test/results/junit/*'
89
- // archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
90
- publishHTML([
91
- allowMissing : false ,
92
- alwaysLinkToLastBuild : false ,
93
- keepAll : false ,
94
- reportDir : ' test/results/html-reports' ,
95
- reportFiles : ' backend-coverage.html' ,
96
- reportName : ' HTML Reports' ,
97
- useWrapperFileDirectly : true
98
- ])
69
+ parallel {
70
+ stage(' Project' ) {
71
+ steps {
72
+ sh ' ./scripts/ci/build-frontend'
73
+ sh ' ./scripts/ci/test-backend'
74
+ // Temporarily disable building backend binaries
75
+ // sh './scripts/ci/build-backend'
76
+ // Build the docker image used for testing below
77
+ sh ''' docker build --pull --no-cache \\
78
+ -t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\
79
+ -f docker/Dockerfile \\
80
+ --build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
81
+ --build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
82
+ --build-arg BUILD_VERSION="${BUILD_VERSION}" \\
83
+ .
84
+ '''
85
+ }
86
+ post {
87
+ success {
88
+ junit ' test/results/junit/*'
89
+ // archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
90
+ publishHTML([
91
+ allowMissing : false ,
92
+ alwaysLinkToLastBuild : false ,
93
+ keepAll : false ,
94
+ reportDir : ' test/results/html-reports' ,
95
+ reportFiles : ' backend-coverage.html' ,
96
+ reportName : ' HTML Reports' ,
97
+ useWrapperFileDirectly : true
98
+ ])
99
+ }
100
+ }
101
+ }
102
+ stage(' Docs' ) {
103
+ steps {
104
+ dir(path : ' docs' ) {
105
+ sh ' yarn install'
106
+ sh ' yarn build'
107
+ }
108
+ }
99
109
}
100
110
}
101
111
}
@@ -185,27 +195,6 @@ pipeline {
185
195
}
186
196
}
187
197
}
188
- stage(' Docs' ) {
189
- when {
190
- not {
191
- equals expected : ' UNSTABLE' , actual : currentBuild. result
192
- }
193
- }
194
- steps {
195
- dir(path : ' docs' ) {
196
- sh ' yarn install'
197
- sh ' yarn build'
198
- }
199
-
200
- // API Docs:
201
- sh ' mkdir -p "docs/.vuepress/dist/api"'
202
- sh ' mv docs/api-schema.json docs/.vuepress/dist/api/'
203
-
204
- dir(path : ' docs/.vuepress/dist' ) {
205
- sh ' tar -czf ../../docs.tgz *'
206
- }
207
- }
208
- }
209
198
stage(' MultiArch Build' ) {
210
199
when {
211
200
not {
@@ -220,31 +209,35 @@ pipeline {
220
209
}
221
210
}
222
211
}
223
- stage(' Docs Deploy' ) {
224
- when {
225
- allOf {
226
- branch ' v3' // TODO: change to master when ready
227
- not {
228
- equals expected : ' UNSTABLE' , actual : currentBuild. result
212
+ stage(' Docs / Comment' ) {
213
+ parallel {
214
+ stage(' Docs Job' ) {
215
+ when {
216
+ allOf {
217
+ branch pattern : " ^(develop|master|v3)\$ " , comparator : " REGEXP"
218
+ not {
219
+ equals expected : ' UNSTABLE' , actual : currentBuild. result
220
+ }
221
+ }
229
222
}
230
- }
231
- }
232
- steps {
233
- npmDocsRelease(" $DOCS_BUCKET " , " $DOCS_CDN " )
234
- }
235
- }
236
- stage(' PR Comment' ) {
237
- when {
238
- allOf {
239
- changeRequest()
240
- not {
241
- equals expected : ' UNSTABLE' , actual : currentBuild. result
223
+ steps {
224
+ build wait : false , job : ' nginx-proxy-manager-docs' , parameters : [string(name : ' docs_branch' , value : " $BRANCH_NAME " )]
242
225
}
243
226
}
244
- }
245
- steps {
246
- script {
247
- npmGithubPrComment(" Docker Image for build ${ BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/${ DOCKER_ORG} /${ IMAGE} ) as `${ DOCKER_ORG} /${ IMAGE} :github-${ BRANCH_LOWER} `\n\n **Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes." , true )
227
+ stage(' PR Comment' ) {
228
+ when {
229
+ allOf {
230
+ changeRequest()
231
+ not {
232
+ equals expected : ' UNSTABLE' , actual : currentBuild. result
233
+ }
234
+ }
235
+ }
236
+ steps {
237
+ script {
238
+ npmGithubPrComment(" Docker Image for build ${ BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${ IMAGE} ) as `jc21/${ IMAGE} :github-${ BRANCH_LOWER} `\n\n **Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes." , true )
239
+ }
240
+ }
248
241
}
249
242
}
250
243
}
0 commit comments