Our new LangChain Academy Course Deep Research with LangGraph is now live! Enroll for free.
OSS (v1-alpha)
LangChain and LangGraph
langchain-jenkins
%pip install --upgrade --quiet langchain-jenkins
import getpass import os def _set_env(var: str): if not os.environ.get(var): os.environ[var] = getpass.getpass(f"{var}: ") _set_env("PASSWORD")
os.environ["PYTHONHTTPSVERIFY"] = "0"
from langchain_jenkins import JenkinsAPIWrapper, JenkinsJobRun tools = [ JenkinsJobRun( api_wrapper=JenkinsAPIWrapper( jenkins_server="https://example.com", username="admin", password=os.environ["PASSWORD"], ) ) ]
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"})
tools[0].invoke({"job": "job01", "parameters": {}, "action": "run"})
resp = tools[0].invoke({"job": "job01", "number": 1, "action": "status"}) if not resp["inProgress"]: print(resp["result"])
tools[0].invoke({"job": "job01", "action": "delete"})