Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevden01/jenkins-python-multibranch-pipeline
Jenkins Multibranch Pipeline setup for a Python application, demonstrating automated builds and testing workflows using Docker and Jenkinsfile integration.
https://github.com/kevden01/jenkins-python-multibranch-pipeline
jenkins python
Last synced: 22 days ago
JSON representation
Jenkins Multibranch Pipeline setup for a Python application, demonstrating automated builds and testing workflows using Docker and Jenkinsfile integration.
- Host: GitHub
- URL: https://github.com/kevden01/jenkins-python-multibranch-pipeline
- Owner: KevDen01
- Created: 2024-10-07T07:35:37.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-26T14:10:20.000Z (29 days ago)
- Last Synced: 2024-12-03T19:09:20.350Z (22 days ago)
- Topics: jenkins, python
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jenkins Multibranch Pipeline Project
This project demonstrates a Jenkins Multibranch Pipeline setup for a Python application.
## Project Structure
- `app.py`: Main application script.
- `test_app.py`: Contains unit tests for `app.py`.
- `Jenkinsfile`: Configuration for Jenkins pipeline.
- `README.md`: Project documentation.## Prerequisites
- Python 3.x
- Jenkins with Multibranch Pipeline Plugin## Setup Instructions
1. **Clone the Repository:**
```bash
git clone https://github.com/KevDen01/Jenkins-Python-Multibranch-Pipeline.git
cd Jenkins-Python-Multibranch-Pipeline
```2. **Create and Activate a Virtual Environment:**
```bash
python3 -m venv venv
source venv/bin/activate # On Windows, use venv\Scripts\activate
```3. **Install Dependencies:**
```bash
pip install -r requirements.txt
```*Note: Ensure `requirements.txt` lists all necessary packages.*
## Running the Application
```bash
python app.py
```## Running Tests
```bash
python -m unittest test_app.py
```## Jenkins Pipeline Setup
1. **Create a Multibranch Pipeline Job:**
- In Jenkins, create a new Multibranch Pipeline job.
- Set the repository URL to this project's GitHub repository.2. **Configure Branch Sources:**
- Add the repository as a branch source.
- Set up credentials if necessary.3. **Define Build Triggers:**
- Configure triggers as per your requirements (e.g., periodic scans, webhook triggers).
4. **Pipeline Execution:**
- Jenkins will automatically detect branches with a `Jenkinsfile` and execute the defined pipeline.
## Contributing
Contributions are welcome! Please fork the repository and submit a pull request.