Exercises
You've learned a lot about how to configure the continuous integration process. Since practice makes perfect, I recommend doing the following exercises:
- Create a Python program that multiplies two numbers passed as command-line parameters. Add unit tests and publish the project on GitHub:
- Create two files:
calculator.py
andtest_calculator.py
. - You can use the
unittest
library at https://docs.python.org/3/library/unittest.html. - Run the program and the unit test.
- Create two files:
- Build the continuous integration pipeline for the Python calculator project:
- Use
Jenkinsfile
to specify the pipeline. - Configure the trigger so that the pipeline runs automatically in case of any commits to the repository.
- The pipeline doesn't need the
Compile
step since Python is an interpretable language. - Run the pipeline and observe the results.
- Try to commit the code that breaks the pipeline build and observe how it is visualized in Jenkins.
- Use