first commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
plugins { id("java-library-conventions") }
|
||||
dependencies {
|
||||
implementation(project(":gateway-module-tool-registry:tool-registry-contract-subjects"))
|
||||
implementation("org.springframework.boot:spring-boot-starter")
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package net.bquarkz.ai.gateway.providers.jenkins;
|
||||
|
||||
import net.bquarkz.ai.gateway.tools.contracts.ToolProvider;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class JenkinsDeployProvider implements ToolProvider {
|
||||
@Override
|
||||
public String getName() { return "jenkins.deploy"; }
|
||||
|
||||
@Override
|
||||
public String getDescription() { return "Trigger a Jenkins deployment"; }
|
||||
|
||||
@Override
|
||||
public List<String> getActions() { return List.of("deploy"); }
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getInputSchema() {
|
||||
return Map.of(
|
||||
"type", "object",
|
||||
"properties", Map.of(
|
||||
"env", Map.of("type", "string", "description", "Target environment"),
|
||||
"branch", Map.of("type", "string", "description", "Branch to deploy")
|
||||
),
|
||||
"required", List.of("env", "branch")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(String action, Map<String, Object> arguments) {
|
||||
return Map.of(
|
||||
"status", "deploy triggered",
|
||||
"jobId", "jenkins-42",
|
||||
"env", arguments.getOrDefault("env", "staging"),
|
||||
"branch", arguments.getOrDefault("branch", "main")
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user