@@ -43,7 +43,7 @@ pipeline {
4343 steps {
4444 script {
4545 // Defaults to the Branch name, which is applies to all branches AND pr's
46- buildxPushTags = " -t docker.io/jc21 /${ IMAGE} :github- ${ BRANCH_LOWER} "
46+ buildxPushTags = " -t docker.io/nginxproxymanager /${ IMAGE} -dev: ${ BRANCH_LOWER} "
4747 }
4848 }
4949 }
@@ -56,6 +56,13 @@ pipeline {
5656 sh ' sed -i -E "s/(version-)[0-9]+\\ .[0-9]+\\ .[0-9]+(-green)/\\ 1${BUILD_VERSION}\\ 2/" README.md'
5757 }
5858 }
59+ stage(' Docker Login' ) {
60+ steps {
61+ withCredentials([usernamePassword(credentialsId : ' jc21-dockerhub' , passwordVariable : ' dpass' , usernameVariable : ' duser' )]) {
62+ sh ' docker login -u "${duser}" -p "${dpass}"'
63+ }
64+ }
65+ }
5966 }
6067 }
6168 stage(' Builds' ) {
@@ -120,6 +127,11 @@ pipeline {
120127 junit ' test/results/junit/*'
121128 sh ' docker-compose down --remove-orphans --volumes -t 30 || true'
122129 }
130+ unstable {
131+ dir(path : ' test/results' ) {
132+ archiveArtifacts(allowEmptyArchive : true , artifacts : ' **/*' , excludes : ' **/*.xml' )
133+ }
134+ }
123135 }
124136 }
125137 stage(' Test Mysql' ) {
@@ -148,20 +160,60 @@ pipeline {
148160 junit ' test/results/junit/*'
149161 sh ' docker-compose down --remove-orphans --volumes -t 30 || true'
150162 }
163+ unstable {
164+ dir(path : ' test/results' ) {
165+ archiveArtifacts(allowEmptyArchive : true , artifacts : ' **/*' , excludes : ' **/*.xml' )
166+ }
167+ }
151168 }
152169 }
153- stage(' MultiArch Build' ) {
170+ stage(' Test Postgres' ) {
171+ environment {
172+ COMPOSE_PROJECT_NAME = " npm_${ BRANCH_LOWER} _${ BUILD_NUMBER} _postgres"
173+ COMPOSE_FILE = ' docker/docker-compose.ci.yml:docker/docker-compose.ci.postgres.yml'
174+ }
154175 when {
155176 not {
156177 equals expected : ' UNSTABLE' , actual : currentBuild. result
157178 }
158179 }
159180 steps {
160- withCredentials([usernamePassword(credentialsId : ' jc21-dockerhub' , passwordVariable : ' dpass' , usernameVariable : ' duser' )]) {
161- sh ' docker login -u "${duser}" -p "${dpass}"'
162- sh " ./scripts/buildx --push ${ buildxPushTags} "
181+ sh ' rm -rf ./test/results/junit/*'
182+ sh ' ./scripts/ci/fulltest-cypress'
183+ }
184+ post {
185+ always {
186+ // Dumps to analyze later
187+ sh ' mkdir -p debug/postgres'
188+ sh ' docker logs $(docker-compose ps --all -q fullstack) > debug/postgres/docker_fullstack.log 2>&1'
189+ sh ' docker logs $(docker-compose ps --all -q stepca) > debug/postgres/docker_stepca.log 2>&1'
190+ sh ' docker logs $(docker-compose ps --all -q pdns) > debug/postgres/docker_pdns.log 2>&1'
191+ sh ' docker logs $(docker-compose ps --all -q pdns-db) > debug/postgres/docker_pdns-db.log 2>&1'
192+ sh ' docker logs $(docker-compose ps --all -q dnsrouter) > debug/postgres/docker_dnsrouter.log 2>&1'
193+ sh ' docker logs $(docker-compose ps --all -q db-postgres) > debug/postgres/docker_db-postgres.log 2>&1'
194+ sh ' docker logs $(docker-compose ps --all -q authentik) > debug/postgres/docker_authentik.log 2>&1'
195+ sh ' docker logs $(docker-compose ps --all -q authentik-redis) > debug/postgres/docker_authentik-redis.log 2>&1'
196+ sh ' docker logs $(docker-compose ps --all -q authentik-ldap) > debug/postgres/docker_authentik-ldap.log 2>&1'
197+
198+ junit ' test/results/junit/*'
199+ sh ' docker-compose down --remove-orphans --volumes -t 30 || true'
200+ }
201+ unstable {
202+ dir(path : ' test/results' ) {
203+ archiveArtifacts(allowEmptyArchive : true , artifacts : ' **/*' , excludes : ' **/*.xml' )
204+ }
205+ }
206+ }
207+ }
208+ stage(' MultiArch Build' ) {
209+ when {
210+ not {
211+ equals expected : ' UNSTABLE' , actual : currentBuild. result
163212 }
164213 }
214+ steps {
215+ sh " ./scripts/buildx --push ${ buildxPushTags} "
216+ }
165217 }
166218 stage(' Docs / Comment' ) {
167219 parallel {
@@ -189,7 +241,13 @@ pipeline {
189241 }
190242 steps {
191243 script {
192- 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 )
244+ npmGithubPrComment(""" Docker Image for build ${ BUILD_NUMBER} is available on
245+ [DockerHub](https://cloud.docker.com/repository/docker/nginxproxymanager/${ IMAGE} -dev)
246+ as `nginxproxymanager/${ IMAGE} -dev:${ BRANCH_LOWER} `
247+
248+ **Note:** ensure you backup your NPM instance before testing this image! Especially if there are database changes
249+ **Note:** this is a different docker image namespace than the official image
250+ """ , true )
193251 }
194252 }
195253 }
@@ -200,20 +258,13 @@ pipeline {
200258 always {
201259 sh ' echo Reverting ownership'
202260 sh ' docker run --rm -v "$(pwd):/data" jc21/ci-tools chown -R "$(id -u):$(id -g)" /data'
203- }
204- success {
205- juxtapose event : ' success'
206- sh ' figlet "SUCCESS"'
261+ printResult(true )
207262 }
208263 failure {
209264 archiveArtifacts(artifacts : ' debug/**/*.*' , allowEmptyArchive : true )
210- juxtapose event : ' failure'
211- sh ' figlet "FAILURE"'
212265 }
213266 unstable {
214267 archiveArtifacts(artifacts : ' debug/**/*.*' , allowEmptyArchive : true )
215- juxtapose event : ' unstable'
216- sh ' figlet "UNSTABLE"'
217268 }
218269 }
219270}
0 commit comments