项目作者: igorstojanovski

项目描述 :
Demonstrates a basic Jenkinsfile
高级语言: Java
项目地址: git://github.com/igorstojanovski/jenkins-pipeline-as-code.git
创建时间: 2019-11-17T07:51:57Z
项目社区:https://github.com/igorstojanovski/jenkins-pipeline-as-code

开源协议:Apache License 2.0

下载


Description

This is a minimal Spring Boot project that is to intended to demonstrate a few things. This project is used in combination with
jenkins-auto-configure, a Jenkins Docker image project.

Jenkinsfile

In the root of the project there is a Jenkinsfile. It can be used to create a Jenkins pipeline. jenkins-auto-configure will pick up this image and start a pipeline based on it.
The configuration in the Jenkinsfile will create a basic pipeline that will build in project and then start two parallel branches. One will run the unit tests and the other will run the integration tests.
This is how the pipeline will look like in Blue Ocean:
Blue Ocean Pipeline

Unit and Integration tests

The test classes demonstrate how to run very basic unit and integration test using JUnit 5. The integration tests have different setup that the unit test. Which is understandable because they need to setup the whole context before running.

Filtering tests with Gradle

In the docker.build file there are two new tasks that filter tests based on tags. The tasks here are used to separate unit from integration tests so they can be run in parallel.

TODO

In order to create a full fledged replica of a production pipeline a few more steps need to be implimented:

  • Generate coverage reports
  • Do a code scan with SonarCloud
  • Upload test reports
  • Deploy
  • Run a smoke test (hint: Postman)