How to put GitHub URL and run commands in Jenkins for Python project?

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.

  1. Navigate to your Jenkins dashboard.

  2. Click “New Item”, enter a name, select “Freestyle project”, and click “OK”.

  3. Source Code Management:

    • Select “Git”.
    • Enter your GitHub repository URL in the “Repository URL” field.
  4. Choose how you want to trigger the build (e.g., “Poll SCM” for periodic checks).

  5. Ensure you have the necessary Python environment or virtual environment set up.

  6. 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
      
  7. Click the “Save” button.

  8. 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.