How to put GitHub URL and run commands in Jenkins for Python project?
Hi Jacqueline
Please follow the given below steps to put GitHub URL and run commands in Jenkins for your Python project.
-
Navigate to your Jenkins dashboard.
-
Click “New Item”, enter a name, select “Freestyle project”, and click “OK”.
-
Source Code Management:
- Select “Git”.
- Enter your GitHub repository URL in the “Repository URL” field.
-
Choose how you want to trigger the build (e.g., “Poll SCM” for periodic checks).
-
Ensure you have the necessary Python environment or virtual environment set up.
-
Click “Add build step” and select “Execute shell” (for Linux/Mac) or “Execute Windows batch command” (for Windows).
- Enter your Python commands. For example:
pip install -r requirements.txt python your_script.py
- Enter your Python commands. For example:
-
Click the “Save” button.
-
Click “Build Now” on the job dashboard to run the Python project.
Note: Ensure you have the necessary plugins (like the Git plugin) installed in Jenkins and that your Jenkins instance has access to the internet to clone the GitHub repository.