flask_string_number_api
Simple Flask API made to demonstrate CI Pipeline in Jenkins using Python
About the API
The API has 4 endpoints which can be categorised under 2 majore operations
- String Operations
- Number Operations
String Operations
- Check Anagrams - GET
/check/anagram/<string1>/<string2>
- Check Palindrome - GET
/check/palindrome/<string>
Number Operations
- Check Prime - GET
/check/prime/<number>
- Check Armstrong Number - GET
/check/armstrong/<number>
Jenkins CI Actions
- Build Job -
pip install -r requirements.txt
- Test Job -
python3 -m pytest .
- Packing Job -
python3 -m zipapp server
The final artifact collected from the CI pipeline is a server.pyz file.
The __main__
file runs on calling python server.pyz