Metadata-Version: 2.1
Name: langchain-jenkins
Version: 0.1.2
Summary: An integration package connecting Jenkins and LangChain
Home-page: https://github.com/Amitgb14/langchain_jenkins
License: MIT
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: langchain-core (>=0.3.15,<0.4.0)
Requires-Dist: python-jenkins (>=1.8.2,<2.0.0)
Project-URL: Repository, https://github.com/Amitgb14/langchain_jenkins
Project-URL: Release Notes, https://github.com/Amitgb14/langchain_jenkins/releases?q=tag%3A%22jenkins%3D%3D0%22&expanded=true
Project-URL: Source Code, https://github.com/Amitgb14/langchain_jenkins/tree/master/libs/partners/jenkins
Description-Content-Type: text/markdown

# langchain-jenkins

This package contains the LangChain integration with Jenkins

## Installation

```bash
pip install -U langchain-jenkins
```

And you should configure credentials by setting the following environment variables:
```bash
export JENKINS_SERVER="https://example.com"
export USERNAME="admin"
export PASSWORD=""
```

* TODO: fill this out

## Tools

`JenkinsJobRun` class exposes tool models from Jenkins.

```python
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
```python

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
```python
tools[0].invoke({"job": "job01", "parameters": {}, "action": "run"})
```

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

### Delete the job
```python
tools[0].invoke({"job": "job01", "action": "delete"})
```

