diff --git a/Jenkinsfile b/Jenkinsfile index f38f0bb..841efba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,39 +72,28 @@ pipeline { } } } - } + stage ("Publish Image") { + steps { + script { + docker.withRegistry('https://index.docker.io/v1/', "${DOCKER_CREDENTIALS}") { + docker.image("${DOCKER_IDENTITY}").push() + docker.image("${DOCKER_IDENTITY_NGINX}").push() + } + } + } + } - - // stage('Tests') { - // steps { - // // Run tests - // sh """ - // docker compose exec php bin/phpunit --log-junit /report/phpunit.xml - // docker compose cp php:/report/phpunit.xml ./phpunit.xml - // """ - // } - // // post { - // // success { - // // script { - // // docker.withRegistry('https://index.docker.io/v1/', "${DOCKER_CREDENTIALS}") { - // // docker.image("${DOCKER_IDENTITY}").push() - // // docker.image("${DOCKER_IDENTITY_NGINX}").push() - // // } - // // } - // // } - // // } - // } - // } - // post { - // always { - // // Publicar los resultados de las pruebas de PHPUnit - // xunit ( - // thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ], - // tools: [ PHPUnit(pattern: 'phpunit.xml') ] - // ) - // // Remove containers - // sh 'docker compose -f ${DOCKER_COMPOSE_FILE} down' - // sh 'docker compose -f ${DOCKER_COMPOSE_FILE} rm -f' - // } - // } + } + post { + always { + // Publicar los resultados de las pruebas de PHPUnit + xunit ( + thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ], + tools: [ PHPUnit(pattern: 'phpunit.xml') ] + ) + // Remove containers + sh 'docker compose -f ${DOCKER_COMPOSE_FILE} down' + sh 'docker compose -f ${DOCKER_COMPOSE_FILE} rm -f' + } + } }