项目作者: lpradel

项目描述 :
Test-driven development of Jenkins pipelines :loop: with Jenkins Pipeline Unit
高级语言: Groovy
项目地址: git://github.com/lpradel/test-driven-jenkins-pipeline.git
创建时间: 2020-09-23T10:55:00Z
项目社区:https://github.com/lpradel/test-driven-jenkins-pipeline

开源协议:Apache License 2.0

下载


Test-driven CI/CD Jenkins pipelines

maven build

This is a Maven-based project demonstrating how to unit-test declarative Jenkins pipelines with the
help of the Jenkins Pipeline Unit framework.

Installation

The build and dependency management of this project is based on Apache Maven.

Maven

Run the following command in your preferred shell:

  1. mvn clean verify

Dependencies

This project has the following dependencies:

Usage

This project demonstrates how test-driven development of declarative Jenkins pipelines can be done.
For this purpose it relies heavily on the
Jenkins Pipeline Unit framework which allows unit-testing
of Jenkins pipelines.

As is tradition in test-driven development, begin by writing, changing or expanding the Groovy-based unit-tests
in test/groovy/ and ensure that the names your unit test classes end with *Test.groovy as is
expected by convention. Once your tests fail, start implementing the necessary changes in Jenkinsfile
which is by convention expected to be in src/main/jenkins.

Once your tests are successful, begin to clean up the mess you made by refactoring your code.

Finally, start over as you expand your Jenkins pipeline :construction_worker:.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :grinning:

License

  1. Copyright 2020 Lukas Pradel
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.