Skip to main content

An integration package connecting Jenkins and LangChain

Project description

langchain-jenkins

This package contains the LangChain integration with Jenkins

Installation

pip install -U langchain-jenkins

And you should configure credentials by setting the following environment variables:

export JENKINS_SERVER="https://example.com"
export USERNAME="admin"
export PASSWORD=""
  • TODO: fill this out

Tools

JenkinsJobRun class exposes tool models from Jenkins.

from langchain_jenkins import JenkinsAPIWrapper, JenkinsJobRun

tools = [
    JenkinsJobRun(
        api_wrapper=JenkinsAPIWrapper(
            jenkins_server="https://example.com",
            username="admin",
            password=os.environ["PASSWORD"],
        )
    )
]

Create the Jenkins job

jenkins_job_content = ""
src_file = "job1.xml"
with open(src_file) as fread:
    jenkins_job_content = fread.read()
tools[0].invoke({"job": "job01", "config_xml": jenkins_job_content, "action": "create"})

Run the job

tools[0].invoke({"job": "job01", "parameters": {}, "action": "run"})

Get job status

resp = tools[0].invoke({"job": "job01", "number": 1, "action": "status"})
if not resp["inProgress"]:
    print(resp["result"])

Delete the job

tools[0].invoke({"job": "job01", "action": "delete"})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_jenkins-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_jenkins-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file langchain_jenkins-0.1.1.tar.gz.

File metadata

  • Download URL: langchain_jenkins-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Darwin/23.6.0

File hashes

Hashes for langchain_jenkins-0.1.1.tar.gz
Algorithm Hash digest
SHA256 40bea1c06c9ea3590dbc21c5e4a43106fcf1b6ee5c4c730b986a7da014cb27d4
MD5 7c5e255254d1e655b78944cea1024cb4
BLAKE2b-256 c81fa7526ee85d60d6691ebb537a67394eff63763537ffe3012e7a4cb65ee334

See more details on using hashes here.

File details

Details for the file langchain_jenkins-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: langchain_jenkins-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Darwin/23.6.0

File hashes

Hashes for langchain_jenkins-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b085030f1d3142fe086c5e0ac1dbe3e862263710633df73efc3bd48b2ae3eb00
MD5 dfdbaa709db6b2c30a2ee42f1a88fa93
BLAKE2b-256 329329f812bb52fdad62ac0078dcca040ea464cb8c07ac769eb8b3a3dbf80051

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page