BugAdding admin console
This commit is contained in:
parent
ebb783f33a
commit
5df7d01a9b
36 changed files with 2441 additions and 197 deletions
|
|
@ -0,0 +1,191 @@
|
|||
package org.chtijbug.drools.console;
|
||||
|
||||
import com.vaadin.annotations.PreserveOnRefresh;
|
||||
import com.vaadin.annotations.Theme;
|
||||
import com.vaadin.data.Property;
|
||||
import com.vaadin.data.util.BeanItemContainer;
|
||||
import com.vaadin.server.VaadinRequest;
|
||||
import com.vaadin.shared.ui.MultiSelectMode;
|
||||
import com.vaadin.spring.annotation.SpringUI;
|
||||
import com.vaadin.ui.*;
|
||||
import com.vaadin.ui.themes.Runo;
|
||||
import org.chtijbug.drools.console.service.JenkinsService;
|
||||
import org.chtijbug.drools.console.service.KieRepositoryService;
|
||||
import org.chtijbug.drools.console.service.KieServerRepositoryService;
|
||||
import org.chtijbug.drools.console.service.model.DisplayData;
|
||||
import org.chtijbug.drools.console.service.model.kie.*;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Theme("runo")
|
||||
@SpringUI
|
||||
@PreserveOnRefresh
|
||||
@SuppressWarnings("serial")
|
||||
public class DroolsAdminConsole extends UI {
|
||||
|
||||
final private Button buttonDeployProject = new Button("Deploy project");
|
||||
final private List<DisplayData> currentSelected = new ArrayList<>();
|
||||
|
||||
// @Autowired
|
||||
// private GitLabRepositoryService gitLabRepositoryService;
|
||||
|
||||
// @Autowired
|
||||
// private GitRepositoryService gitRepositoryService;
|
||||
@Autowired
|
||||
private KieRepositoryService kieRepositoryService;
|
||||
@Autowired
|
||||
private KieServerRepositoryService kieServerRepositoryService;
|
||||
@Autowired
|
||||
private JenkinsService jenkinsService;
|
||||
private TextField userNameTextField;
|
||||
private PasswordField userpasswdTextField;
|
||||
private Table gitReposTable;
|
||||
private BeanItemContainer<DisplayData> gitReposListContainer;
|
||||
|
||||
public DroolsAdminConsole() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init(VaadinRequest request) {
|
||||
final VerticalLayout layout = new VerticalLayout();
|
||||
KieConfigurationData configKie = AppContext.getApplicationContext().getBean(KieConfigurationData.class);
|
||||
// GitLabConfigurationData configGitLab = AppContext.getApplicationContext().getBean(GitLabConfigurationData.class);
|
||||
// JenkinsConfigurationData jenkinsConfigurationData = AppContext.getApplicationContext().getBean(JenkinsConfigurationData.class);
|
||||
|
||||
// gitLabRepositoryService = AppContext.getApplicationContext().getBean(GitLabRepositoryService.class);
|
||||
|
||||
//jenkinsService = AppContext.getApplicationContext().getBean(JenkinsService.class);
|
||||
|
||||
layout.setMargin(true);
|
||||
setContent(layout);
|
||||
TextField urlTextField = new TextField("Kie-Wb url");
|
||||
urlTextField.setValue(configKie.getKiewbUrl());
|
||||
urlTextField.setMaxLength(200);
|
||||
layout.addComponent(urlTextField);
|
||||
HorizontalLayout userHorizontal = new HorizontalLayout();
|
||||
layout.addComponent(userHorizontal);
|
||||
userNameTextField = new TextField("User name");
|
||||
userNameTextField.setValue(configKie.getUserName());
|
||||
userHorizontal.addComponent(userNameTextField);
|
||||
userpasswdTextField = new PasswordField("Password");
|
||||
userpasswdTextField.setValue(configKie.getPassword());
|
||||
userHorizontal.addComponent(userpasswdTextField);
|
||||
Button button = new Button("Repositories");
|
||||
button.addStyleName(Runo.BUTTON_SMALL);
|
||||
gitReposListContainer = new BeanItemContainer<>(DisplayData.class);
|
||||
|
||||
gitReposTable = new Table("List of repository/project", gitReposListContainer);
|
||||
gitReposTable.setSelectable(true);
|
||||
gitReposTable.setMultiSelectMode(MultiSelectMode.SIMPLE);
|
||||
//gitReposTable.
|
||||
button.addClickListener((Button.ClickListener) event -> {
|
||||
this.refreshList();
|
||||
});
|
||||
layout.addComponent(button);
|
||||
layout.addComponent(gitReposTable);
|
||||
|
||||
|
||||
layout.addComponent(buttonDeployProject);
|
||||
buttonDeployProject.addStyleName(Runo.BUTTON_SMALL);
|
||||
|
||||
gitReposTable.addValueChangeListener(new Property.ValueChangeListener() {
|
||||
public void valueChange(Property.ValueChangeEvent event) {
|
||||
currentSelected.clear();
|
||||
if (gitReposTable.getValue() != null) {
|
||||
currentSelected.add((DisplayData) gitReposTable.getValue());
|
||||
buttonDeployProject.setEnabled(true);
|
||||
} else {
|
||||
buttonDeployProject.setEnabled(false);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
buttonDeployProject.addClickListener((Button.ClickListener) event -> {
|
||||
if (currentSelected.size() == 1) {
|
||||
DisplayData displayData = currentSelected.get(0);
|
||||
KieConfigurationData config = AppContext.getApplicationContext().getBean(KieConfigurationData.class);
|
||||
kieRepositoryService = AppContext.getApplicationContext().getBean(KieRepositoryService.class);
|
||||
|
||||
JobStatus result = kieRepositoryService.buildProject(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||
userpasswdTextField.getValue(), displayData.getSpaceName(), displayData.getProjectName(), "compile");
|
||||
|
||||
|
||||
result = kieRepositoryService.buildProject(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||
userpasswdTextField.getValue(), displayData.getSpaceName(), displayData.getProjectName(), "install");
|
||||
|
||||
kieRepositoryService.waitForJobToBeEnded(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||
userpasswdTextField.getValue(), result.getJobId());
|
||||
if (displayData.getContainerId() != null && displayData.getContainerId().length() > 0) {
|
||||
KieServerJobStatus jobresult = kieServerRepositoryService.stopContainer(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword(), displayData.getContainerId());
|
||||
if (jobresult != null
|
||||
&& "SUCCESS".equals(jobresult.getType())) {
|
||||
}
|
||||
|
||||
}
|
||||
KieContainerRequest newContainer = new KieContainerRequest();
|
||||
newContainer.setContainerId(displayData.getContainerId());
|
||||
newContainer.setReleaseId(new ReleaseDefinition());
|
||||
newContainer.getReleaseId().setArtifactId(displayData.getProjectName());
|
||||
newContainer.getReleaseId().setGroupId(displayData.getProjectGroupID());
|
||||
newContainer.getReleaseId().setVersion(displayData.getProjectVersion());
|
||||
KieContainerInfo toto = kieServerRepositoryService.createContainer(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword(), displayData.getProjectName(), newContainer);
|
||||
System.out.println("coucou");
|
||||
this.refreshList();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
buttonDeployProject.setEnabled(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
gitReposListContainer.removeAllItems();
|
||||
KieConfigurationData config = AppContext.getApplicationContext().getBean(KieConfigurationData.class);
|
||||
kieRepositoryService = AppContext.getApplicationContext().getBean(KieRepositoryService.class);
|
||||
List<KieContainerInfo> listcontainers = kieServerRepositoryService.getContainerList(config.getKieserverUrl(), config.getKieserverUserName(), config.getKieserverPassword());
|
||||
|
||||
List<Space> listSpaces = kieRepositoryService.getListSpaces(config.getKiewbUrl(), userNameTextField.getValue(),
|
||||
userpasswdTextField.getValue());
|
||||
for (Space space : listSpaces) {
|
||||
for (SpaceProject spaceProject : space.getProjects()) {
|
||||
DisplayData displayData = new DisplayData();
|
||||
displayData.setSpaceName(space.getName());
|
||||
displayData.setSpaceDescription(space.getDescription());
|
||||
displayData.setSpaceDefaultGroupID(space.getDefaultGroupId());
|
||||
displayData.setSpaceOwner(space.getOwner());
|
||||
displayData.setProjectName(spaceProject.getName());
|
||||
displayData.setProjectGroupID(spaceProject.getGroupId());
|
||||
displayData.setProjectVersion(spaceProject.getVersion());
|
||||
displayData.setProjectDescription(spaceProject.getDescription());
|
||||
for (SpaceProjectURI uri : spaceProject.getPublicURIs()) {
|
||||
if (uri.getProtocol().equals("git")) {
|
||||
displayData.setProjectGitAddress(uri.getUri());
|
||||
} else {
|
||||
displayData.setProjectSSHAdress(uri.getUri());
|
||||
}
|
||||
}
|
||||
for (KieContainerInfo kie : listcontainers) {
|
||||
if (kie.getGroupId().equals(displayData.getProjectGroupID())
|
||||
&& kie.getArtifactId().equals(displayData.getProjectName())
|
||||
&& kie.getVersion().equals(displayData.getProjectVersion())) {
|
||||
displayData.setKieServerArtifactId(kie.getArtifactId());
|
||||
displayData.setKieServerGroupId(kie.getGroupId());
|
||||
displayData.setKieServerVersion(kie.getVersion());
|
||||
displayData.setContainerId(kie.getContainerId());
|
||||
displayData.setContainerAlias(kie.getContainerAlias());
|
||||
}
|
||||
}
|
||||
gitReposListContainer.addBean(displayData);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("coucou");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package org.chtijbug.drools.console;
|
||||
|
||||
|
||||
import org.chtijbug.drools.console.service.util.ApplicationContextProvider;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
@Configuration
|
||||
@SpringBootApplication
|
||||
//@ComponentScan({"com.assurfleet.front.courtier.petiteflotte.maj","com.assurfleet.jms.services"})
|
||||
@PropertySource("classpath:application.properties")
|
||||
@ImportResource("classpath:applicationContext.xml")
|
||||
public class DroolsSpringBootConsoleApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DroolsSpringBootConsoleApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ApplicationContextProvider getAppplicationContext() {
|
||||
ApplicationContextProvider applicationContextProvider = new ApplicationContextProvider();
|
||||
return applicationContextProvider;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package org.chtijbug.drools.console.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.chtijbug.drools.console.service.model.gitlab.GroupElementResponse;
|
||||
import org.chtijbug.drools.console.service.model.gitlab.ProjectMoveResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RequestCallback;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
@Service
|
||||
public class GitLabRepositoryService {
|
||||
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(GitLabRepositoryService.class);
|
||||
|
||||
|
||||
private RestTemplate restTemplateKiewb = new RestTemplate();
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
public List<GroupElementResponse> getListGitRepostitories(String url, String token, String groupName) {
|
||||
|
||||
String completeurl = url + "/groups/" + groupName + "/projects";
|
||||
logger.info("url gitlab : " + completeurl);
|
||||
ResponseEntity<List<GroupElementResponse>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, token), clientHttpResponse -> {
|
||||
List<GroupElementResponse> extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
GroupElementResponse[] values = mapper.readValue(result, GroupElementResponse[].class);
|
||||
extractedResponse = Arrays.asList(values);
|
||||
}
|
||||
ResponseEntity<List<GroupElementResponse>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
List<GroupElementResponse> reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
return reponseMoteur;
|
||||
}
|
||||
|
||||
public GroupElementResponse createProjectForUser(String url, String token, String projectName) {
|
||||
|
||||
String completeurl = url + "/projects?name=" + projectName;
|
||||
logger.info("url moteur reco : " + completeurl);
|
||||
ResponseEntity<GroupElementResponse> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.POST, requestCallback(null, token), clientHttpResponse -> {
|
||||
GroupElementResponse extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
extractedResponse = mapper.readValue(result, GroupElementResponse.class);
|
||||
}
|
||||
ResponseEntity<GroupElementResponse> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
GroupElementResponse reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
return reponseMoteur;
|
||||
}
|
||||
|
||||
public ProjectMoveResponse moveProjectTpGroup(String url, String token, String projectid, String groupName) {
|
||||
|
||||
String completeurl = url + "/groups/" + groupName + "/projects/" + projectid;
|
||||
logger.info("url moteur reco : " + completeurl);
|
||||
ResponseEntity<ProjectMoveResponse> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.POST, requestCallback(null, token), clientHttpResponse -> {
|
||||
ProjectMoveResponse extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
extractedResponse = mapper.readValue(result, ProjectMoveResponse.class);
|
||||
}
|
||||
ResponseEntity<ProjectMoveResponse> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
ProjectMoveResponse reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
return reponseMoteur;
|
||||
}
|
||||
///groups/:id/projects/:project_id
|
||||
|
||||
private RequestCallback requestCallback(final Object content, String token) {
|
||||
return clientHttpRequest -> {
|
||||
if (content != null) {
|
||||
mapper.writeValue(clientHttpRequest.getBody(), content);
|
||||
}
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
|
||||
|
||||
String authHeader = new String(token);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
"Private-Token", authHeader);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package org.chtijbug.drools.console.service;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
@Service
|
||||
public class GitRepositoryService {
|
||||
|
||||
public static void main(String[] args) {
|
||||
GitRepositoryService service = new GitRepositoryService();
|
||||
service.executeCommand("cd /Users/nheron/kie-base-jbpm-6/niodir/.niogit/nico1.git && ./hooks/post-commit ");
|
||||
}
|
||||
|
||||
public void addHookToRepo(String projectName, String gitBaseUrl) throws IOException {
|
||||
String fileBase = System.getProperty("org.uberfire.nio.git.dir");
|
||||
if (fileBase != null) {
|
||||
String gitdirectory = fileBase + "/.niogit/" + projectName + ".git";
|
||||
String gitFileName = fileBase + "/.niogit/" + projectName + ".git/hooks/post-commit";
|
||||
/**
|
||||
* #!/bin/sh
|
||||
* REPO=git@gitlab.pymma-software.com:nheron/jbpm-edop-base-example.git
|
||||
* git push --mirror $REPO;
|
||||
* echo "====push done ===="
|
||||
*/
|
||||
String gitRepo = gitBaseUrl + "/" + projectName + ".git";
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append("#!/bin/sh").append("\n");
|
||||
stringBuilder.append("currentDir=$PWD").append("\n");
|
||||
stringBuilder.append("cd ").append(gitdirectory).append("\n");
|
||||
stringBuilder.append("REPO=").append(gitRepo).append("\n");
|
||||
stringBuilder.append("git push --mirror $REPO;").append("\n");
|
||||
stringBuilder.append("echo \"====push done ====\" ").append("\n");
|
||||
stringBuilder.append("cd $currentDir ").append("\n");
|
||||
File file = new File(gitFileName);
|
||||
FileUtils.writeStringToFile(file, stringBuilder.toString());
|
||||
file.setExecutable(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void executeHookPush(String projectName, String gitBaseUrl) {
|
||||
String fileBase = System.getProperty("org.uberfire.nio.git.dir");
|
||||
if (fileBase != null) {
|
||||
|
||||
String gitFileName = fileBase + "/.niogit/" + projectName + ".git/hooks/post-commit";
|
||||
this.executeCommand(gitFileName);
|
||||
}
|
||||
}
|
||||
|
||||
private String executeCommand(String command) {
|
||||
|
||||
StringBuffer output = new StringBuffer();
|
||||
|
||||
Process process;
|
||||
try {
|
||||
System.out.println(command);
|
||||
System.out.println("============Command start======================");
|
||||
process = Runtime.getRuntime().exec(command);
|
||||
process.waitFor();
|
||||
System.out.println("=============Command Stop=====================");
|
||||
new Thread(() -> {
|
||||
try {
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
String line = "";
|
||||
try {
|
||||
while ((line = reader.readLine()) != null)
|
||||
System.out.println(line);
|
||||
} finally {
|
||||
reader.close();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
|
||||
// Consommation de la sortie d'erreur de l'application externe dans un Thread separe
|
||||
new Thread(() -> {
|
||||
try {
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
|
||||
String line = "";
|
||||
try {
|
||||
while ((line = reader.readLine()) != null) {
|
||||
System.out.println(line);
|
||||
// Traitement du flux d'erreur de l'application si besoin est
|
||||
}
|
||||
} finally {
|
||||
reader.close();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return output.toString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package org.chtijbug.drools.console.service;
|
||||
|
||||
import com.offbytwo.jenkins.JenkinsServer;
|
||||
import com.offbytwo.jenkins.model.Job;
|
||||
import com.offbytwo.jenkins.model.JobWithDetails;
|
||||
import com.offbytwo.jenkins.model.View;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.chtijbug.drools.console.service.model.gitlab.GitLabConfigurationData;
|
||||
import org.chtijbug.drools.console.service.model.jenkins.JenkinsConfigurationData;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieConfigurationData;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class JenkinsService {
|
||||
JenkinsServer jenkins = null;
|
||||
|
||||
public void createJobForRepo(String jenkinsServerUrl, String username, String password, String viewName, String groupId, String artifactId, String pomXml, String nexusName, String nexusUrl, String jdkVersion) throws URISyntaxException, IOException {
|
||||
KieConfigurationData configKie = AppContext.getApplicationContext().getBean(KieConfigurationData.class);
|
||||
GitLabConfigurationData configGitLab = AppContext.getApplicationContext().getBean(GitLabConfigurationData.class);
|
||||
JenkinsConfigurationData jenkinsConfigurationData = AppContext.getApplicationContext().getBean(JenkinsConfigurationData.class);
|
||||
|
||||
if (jenkins == null) {
|
||||
jenkins = new JenkinsServer(new URI(jenkinsServerUrl), username, password);
|
||||
|
||||
}
|
||||
|
||||
Map<String, View> views = jenkins.getViews();
|
||||
|
||||
if (views.containsKey(jenkinsConfigurationData.getGroupName())) {
|
||||
View view = views.get(viewName);
|
||||
InputStream stream = new ClassPathResource("/META-INF/DefaultJbpmArtefactJenkinsBuildProject.xml").getInputStream();
|
||||
String fileContent = IOUtils.toString(stream);
|
||||
fileContent = fileContent.replace(":gitRepoUrl", configGitLab.getBaseUrl() + "/" + artifactId + ".git");
|
||||
fileContent = fileContent.replace(":gitCredentials", jenkinsConfigurationData.getCredentials());
|
||||
fileContent = fileContent.replace(":groupId", groupId);
|
||||
fileContent = fileContent.replace(":artifactid", artifactId);
|
||||
fileContent = fileContent.replace(":pomxml", pomXml);
|
||||
fileContent = fileContent.replace(":nexusName", nexusName);
|
||||
fileContent = fileContent.replace(":nexusUrl", nexusUrl);
|
||||
fileContent = fileContent.replace(":jdkVersion", jdkVersion);
|
||||
|
||||
String newJobName = groupId.replace(".", "dot") + "dot" + artifactId;
|
||||
jenkins.createJob(newJobName, fileContent, false);
|
||||
boolean jobNotYetCreated = true;
|
||||
while (jobNotYetCreated) {
|
||||
JobWithDetails jobWithDetails = jenkins.getJob(newJobName);
|
||||
if (jobWithDetails != null) {
|
||||
jobNotYetCreated = false;
|
||||
} else {
|
||||
synchronized (this) {
|
||||
try {
|
||||
Thread.currentThread().wait(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
InputStream streamView = new ClassPathResource("/META-INF/DefaultViewConfig.xml").getInputStream();
|
||||
String fileContentView = IOUtils.toString(streamView);
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (Job job : view.getJobs()) {
|
||||
stringBuilder.append("<string>").append(job.getName()).append("</string>").append("\n");
|
||||
}
|
||||
stringBuilder.append("<string>").append(newJobName).append("</string>").append("\n");
|
||||
fileContentView = fileContentView.replace(":listJobs", stringBuilder.toString());
|
||||
jenkins.updateView(view.getName(), fileContentView);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package org.chtijbug.drools.console.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.chtijbug.drools.console.service.model.kie.JobStatus;
|
||||
import org.chtijbug.drools.console.service.model.kie.Space;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RequestCallback;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
@Service
|
||||
public class KieRepositoryService {
|
||||
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(KieRepositoryService.class);
|
||||
|
||||
|
||||
private RestTemplate restTemplateKiewb = new RestTemplate();
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
|
||||
public List<Space> getListSpaces(String url, String username, String password) {
|
||||
String completeurl = url + "/spaces";
|
||||
logger.info("url moteur reco : " + completeurl);
|
||||
ResponseEntity<List<Space>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
List<Space> extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
Space[] values = mapper.readValue(result, Space[].class);
|
||||
extractedResponse = Arrays.asList(values);
|
||||
}
|
||||
ResponseEntity<List<Space>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
List<Space> reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
return reponseMoteur;
|
||||
}
|
||||
|
||||
public JobStatus buildProject(String url, String username, String password, String space, String project, String command) {
|
||||
String completeurl = url + "/spaces/" + space + "/projects/" + project + "/maven/" + command;
|
||||
logger.info("url Maven install : " + completeurl);
|
||||
ResponseEntity<JobStatus> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.POST, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
JobStatus extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
JobStatus values = mapper.readValue(result, JobStatus.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<JobStatus> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
JobStatus reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
return reponseMoteur;
|
||||
}
|
||||
|
||||
public JobStatus getStatusJobID(String url, String username, String password, String jobID) {
|
||||
|
||||
String completeurl = url + "/jobs/" + jobID;
|
||||
logger.info("url moteur reco : " + completeurl);
|
||||
ResponseEntity<JobStatus> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
JobStatus extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
extractedResponse = mapper.readValue(result, JobStatus.class);
|
||||
|
||||
}
|
||||
ResponseEntity<JobStatus> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
JobStatus reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
return reponseMoteur;
|
||||
}
|
||||
|
||||
|
||||
private RequestCallback requestCallback(final Object content, String username, String password) {
|
||||
return clientHttpRequest -> {
|
||||
if (content != null) {
|
||||
mapper.writeValue(clientHttpRequest.getBody(), content);
|
||||
}
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
|
||||
String auth = username + ":" + password;
|
||||
byte[] encodedAuth = Base64.encodeBase64(
|
||||
auth.getBytes(Charset.forName("UTF-8")));
|
||||
String authHeader = "Basic " + new String(encodedAuth);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.AUTHORIZATION, authHeader);
|
||||
};
|
||||
}
|
||||
|
||||
public String waitForJobToBeEnded(String url, String username, String password, String jobID) {
|
||||
String isJobDone = "NO";
|
||||
while ("NO".equals(isJobDone)) {
|
||||
JobStatus jobStatus = this.getStatusJobID(url,
|
||||
username,
|
||||
password, jobID);
|
||||
if ("DUPLICATE_RESOURCE".equals(jobStatus.getStatus())
|
||||
|| "SUCCESS".equals(jobStatus.getStatus())) {
|
||||
isJobDone = "YES";
|
||||
System.out.println("JonId=" + jobID + " finished");
|
||||
} else if ("ACCEPTED".equals(jobStatus.getStatus())
|
||||
|| ("APPROVED".equals(jobStatus.getStatus()))) {
|
||||
try {
|
||||
System.out.println("JonId=" + jobID + " not yet finished");
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
return isJobDone;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
package org.chtijbug.drools.console.service;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieContainerInfo;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieContainerRequest;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieServerJobStatus;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RequestCallback;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
|
||||
@Service
|
||||
public class KieServerRepositoryService {
|
||||
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(KieServerRepositoryService.class);
|
||||
|
||||
|
||||
private RestTemplate restTemplateKiewb = new RestTemplate();
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
public List<KieContainerInfo> getContainerList(String url, String username, String password) {
|
||||
List<KieContainerInfo> results = new ArrayList<>();
|
||||
String completeurl = url + "/containers";
|
||||
logger.info("url kie server container : " + completeurl);
|
||||
ResponseEntity<Map<String, Object>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
Map<String, Object> extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
Map<String, Object> map = mapper.readValue(
|
||||
result,
|
||||
new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Map<String, Object> values = mapper.readValue(result, Map.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<Map<String, Object>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
Map<String, Object> reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
Object resultMap = reponseMoteur.get("result");
|
||||
Object containersMap = ((Map) resultMap).get("kie-containers");
|
||||
Map containerMap = ((Map) containersMap);
|
||||
List<Map<String, Object>> listContainers = (List) containerMap.get("kie-container");
|
||||
for (Map<String, Object> container : listContainers) {
|
||||
KieContainerInfo kieContainerInfo = new KieContainerInfo();
|
||||
System.out.println("coucou");
|
||||
kieContainerInfo.setContainerId((String) container.get("container-id"));
|
||||
Map artifact = (Map) container.get("resolved-release-id");
|
||||
kieContainerInfo.setArtifactId((String) artifact.get("artifact-id"));
|
||||
kieContainerInfo.setGroupId((String) artifact.get("group-id"));
|
||||
kieContainerInfo.setVersion((String) artifact.get("version"));
|
||||
kieContainerInfo.setContainerAlias((String) container.get("container-alias"));
|
||||
results.add(kieContainerInfo);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public KieServerJobStatus stopContainer(String url, String username, String password, String containerId) {
|
||||
KieServerJobStatus results = null;
|
||||
String completeurl = url + "/containers/" + containerId;
|
||||
logger.info("url kie server container : " + completeurl);
|
||||
ResponseEntity<KieServerJobStatus> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.DELETE, requestCallback(null, username, password), clientHttpResponse -> {
|
||||
KieServerJobStatus extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
KieServerJobStatus values = mapper.readValue(result, KieServerJobStatus.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<KieServerJobStatus> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
KieServerJobStatus reponseMoteur;
|
||||
reponseMoteur = response.getBody();
|
||||
return reponseMoteur;
|
||||
}
|
||||
|
||||
public KieContainerInfo createContainer(String url, String username, String password, String containerId, KieContainerRequest request) {
|
||||
String completeurl = url + "/containers/" + containerId;
|
||||
logger.info("url kie server container : " + completeurl);
|
||||
ResponseEntity<Map<String, Object>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.PUT, requestCallback(request, username, password), clientHttpResponse -> {
|
||||
Map<String, Object> extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
Map<String, Object> map = mapper.readValue(
|
||||
result,
|
||||
new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Map<String, Object> values = mapper.readValue(result, Map.class);
|
||||
extractedResponse = values;
|
||||
}
|
||||
ResponseEntity<Map<String, Object>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
Map<String, Object> reponseMoteur;
|
||||
|
||||
reponseMoteur = response.getBody();
|
||||
|
||||
KieContainerInfo result = new KieContainerInfo();
|
||||
return result;
|
||||
}
|
||||
|
||||
private RequestCallback requestCallback(final Object content, String username, String password) {
|
||||
return clientHttpRequest -> {
|
||||
if (content != null) {
|
||||
mapper.writeValue(clientHttpRequest.getBody(), content);
|
||||
}
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
|
||||
String auth = username + ":" + password;
|
||||
byte[] encodedAuth = Base64.encodeBase64(
|
||||
auth.getBytes(Charset.forName("UTF-8")));
|
||||
String authHeader = "Basic " + new String(encodedAuth);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.AUTHORIZATION, authHeader);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
package org.chtijbug.drools.console.service.model;
|
||||
|
||||
public class DisplayData {
|
||||
private String spaceName;
|
||||
private String spaceDescription;
|
||||
private String projectName;
|
||||
private String projectGroupID;
|
||||
private String projectVersion;
|
||||
private String projectDescription;
|
||||
private String projectGitAddress;
|
||||
private String projectSSHAdress;
|
||||
private String spaceOwner;
|
||||
private String spaceDefaultGroupID;
|
||||
private String containerId;
|
||||
private String kieServerArtifactId;
|
||||
private String kieServerGroupId;
|
||||
private String kieServerVersion;
|
||||
private String containerAlias;
|
||||
|
||||
public String getSpaceName() {
|
||||
return spaceName;
|
||||
}
|
||||
|
||||
public void setSpaceName(String spaceName) {
|
||||
this.spaceName = spaceName;
|
||||
}
|
||||
|
||||
public String getSpaceDescription() {
|
||||
return spaceDescription;
|
||||
}
|
||||
|
||||
public void setSpaceDescription(String spaceDescription) {
|
||||
this.spaceDescription = spaceDescription;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getProjectGroupID() {
|
||||
return projectGroupID;
|
||||
}
|
||||
|
||||
public void setProjectGroupID(String projectGroupID) {
|
||||
this.projectGroupID = projectGroupID;
|
||||
}
|
||||
|
||||
public String getProjectVersion() {
|
||||
return projectVersion;
|
||||
}
|
||||
|
||||
public void setProjectVersion(String projectVersion) {
|
||||
this.projectVersion = projectVersion;
|
||||
}
|
||||
|
||||
public String getProjectDescription() {
|
||||
return projectDescription;
|
||||
}
|
||||
|
||||
public void setProjectDescription(String projectDescription) {
|
||||
this.projectDescription = projectDescription;
|
||||
}
|
||||
|
||||
public String getProjectGitAddress() {
|
||||
return projectGitAddress;
|
||||
}
|
||||
|
||||
public void setProjectGitAddress(String projectGitAddress) {
|
||||
this.projectGitAddress = projectGitAddress;
|
||||
}
|
||||
|
||||
public String getProjectSSHAdress() {
|
||||
return projectSSHAdress;
|
||||
}
|
||||
|
||||
public void setProjectSSHAdress(String projectSSHAdress) {
|
||||
this.projectSSHAdress = projectSSHAdress;
|
||||
}
|
||||
|
||||
public String getSpaceOwner() {
|
||||
return spaceOwner;
|
||||
}
|
||||
|
||||
public void setSpaceOwner(String spaceOwner) {
|
||||
this.spaceOwner = spaceOwner;
|
||||
}
|
||||
|
||||
public String getSpaceDefaultGroupID() {
|
||||
return spaceDefaultGroupID;
|
||||
}
|
||||
|
||||
public void setSpaceDefaultGroupID(String spaceDefaultGroupID) {
|
||||
this.spaceDefaultGroupID = spaceDefaultGroupID;
|
||||
}
|
||||
|
||||
public String getContainerId() {
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setContainerId(String containerId) {
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public String getKieServerArtifactId() {
|
||||
return kieServerArtifactId;
|
||||
}
|
||||
|
||||
public void setKieServerArtifactId(String kieServerArtifactId) {
|
||||
this.kieServerArtifactId = kieServerArtifactId;
|
||||
}
|
||||
|
||||
public String getKieServerGroupId() {
|
||||
return kieServerGroupId;
|
||||
}
|
||||
|
||||
public void setKieServerGroupId(String kieServerGroupId) {
|
||||
this.kieServerGroupId = kieServerGroupId;
|
||||
}
|
||||
|
||||
public String getKieServerVersion() {
|
||||
return kieServerVersion;
|
||||
}
|
||||
|
||||
public void setKieServerVersion(String kieServerVersion) {
|
||||
this.kieServerVersion = kieServerVersion;
|
||||
}
|
||||
|
||||
public String getContainerAlias() {
|
||||
return containerAlias;
|
||||
}
|
||||
|
||||
public void setContainerAlias(String containerAlias) {
|
||||
this.containerAlias = containerAlias;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package org.chtijbug.drools.console.service.model.gitlab;
|
||||
|
||||
public class CreateProjectRequest {
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package org.chtijbug.drools.console.service.model.gitlab;
|
||||
|
||||
public class GitLabConfigurationData {
|
||||
|
||||
private String url;
|
||||
|
||||
private String token;
|
||||
|
||||
private String groupName;
|
||||
|
||||
private String baseUrl;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getBaseUrl() {
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
public void setBaseUrl(String baseUrl) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,368 @@
|
|||
package org.chtijbug.drools.console.service.model.gitlab;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class GroupElementResponse {
|
||||
private String id;
|
||||
private String description;
|
||||
private String default_branch;
|
||||
private Object tag_list;
|
||||
private Object owner;
|
||||
private String thePublic;
|
||||
private String archived;
|
||||
private String runners_token;
|
||||
private String visibility;
|
||||
private String visibility_level;
|
||||
private String ssh_url_to_repo;
|
||||
private String http_url_to_repo;
|
||||
private String web_url;
|
||||
private String name;
|
||||
private String name_with_namespace;
|
||||
private String path;
|
||||
private String path_with_namespace;
|
||||
private String container_registry_enabled;
|
||||
private String issues_enabled;
|
||||
private String merge_requests_enabled;
|
||||
private String wiki_enabled;
|
||||
private String builds_enabled;
|
||||
private String jobs_enabled;
|
||||
private String snippets_enabled;
|
||||
private String created_at;
|
||||
private String last_activity_at;
|
||||
private String shared_runners_enabled;
|
||||
private String lfs_enabled;
|
||||
private String creator_id;
|
||||
private Object namespace;
|
||||
private String avatar_url;
|
||||
private String star_count;
|
||||
private String forks_count;
|
||||
private String open_issues_count;
|
||||
private String public_jobs;
|
||||
private String public_builds;
|
||||
private Object shared_with_groups;
|
||||
private String only_allow_merge_if_build_succeeds;
|
||||
private String request_access_enabled;
|
||||
private String only_allow_merge_if_all_discussions_are_resolved;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDefault_branch() {
|
||||
return default_branch;
|
||||
}
|
||||
|
||||
public void setDefault_branch(String default_branch) {
|
||||
this.default_branch = default_branch;
|
||||
}
|
||||
|
||||
@JsonProperty("public")
|
||||
public String getThePublic() {
|
||||
return thePublic;
|
||||
}
|
||||
|
||||
public void setThePublic(String thePublic) {
|
||||
this.thePublic = thePublic;
|
||||
}
|
||||
|
||||
public String getContainer_registry_enabled() {
|
||||
return container_registry_enabled;
|
||||
}
|
||||
|
||||
public void setContainer_registry_enabled(String container_registry_enabled) {
|
||||
this.container_registry_enabled = container_registry_enabled;
|
||||
}
|
||||
|
||||
public Object getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(Object owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getBuilds_enabled() {
|
||||
return builds_enabled;
|
||||
}
|
||||
|
||||
public void setBuilds_enabled(String builds_enabled) {
|
||||
this.builds_enabled = builds_enabled;
|
||||
}
|
||||
|
||||
public String getLfs_enabled() {
|
||||
return lfs_enabled;
|
||||
}
|
||||
|
||||
public void setLfs_enabled(String lfs_enabled) {
|
||||
this.lfs_enabled = lfs_enabled;
|
||||
}
|
||||
|
||||
public String getRunners_token() {
|
||||
return runners_token;
|
||||
}
|
||||
|
||||
public void setRunners_token(String runners_token) {
|
||||
this.runners_token = runners_token;
|
||||
}
|
||||
|
||||
public String getPublic_builds() {
|
||||
return public_builds;
|
||||
}
|
||||
|
||||
public void setPublic_builds(String public_builds) {
|
||||
this.public_builds = public_builds;
|
||||
}
|
||||
|
||||
public String getOnly_allow_merge_if_build_succeeds() {
|
||||
return only_allow_merge_if_build_succeeds;
|
||||
}
|
||||
|
||||
public void setOnly_allow_merge_if_build_succeeds(String only_allow_merge_if_build_succeeds) {
|
||||
this.only_allow_merge_if_build_succeeds = only_allow_merge_if_build_succeeds;
|
||||
}
|
||||
|
||||
public String getOnly_allow_merge_if_all_discussions_are_resolved() {
|
||||
return only_allow_merge_if_all_discussions_are_resolved;
|
||||
}
|
||||
|
||||
public void setOnly_allow_merge_if_all_discussions_are_resolved(String only_allow_merge_if_all_discussions_are_resolved) {
|
||||
this.only_allow_merge_if_all_discussions_are_resolved = only_allow_merge_if_all_discussions_are_resolved;
|
||||
}
|
||||
|
||||
|
||||
public String getVisibility_level() {
|
||||
return visibility_level;
|
||||
}
|
||||
|
||||
public void setVisibility_level(String visibility_level) {
|
||||
this.visibility_level = visibility_level;
|
||||
}
|
||||
|
||||
public String getArchived() {
|
||||
return archived;
|
||||
}
|
||||
|
||||
public void setArchived(String archived) {
|
||||
this.archived = archived;
|
||||
}
|
||||
|
||||
public String getVisibility() {
|
||||
return visibility;
|
||||
}
|
||||
|
||||
public void setVisibility(String visibility) {
|
||||
this.visibility = visibility;
|
||||
}
|
||||
|
||||
public String getSsh_url_to_repo() {
|
||||
return ssh_url_to_repo;
|
||||
}
|
||||
|
||||
public void setSsh_url_to_repo(String ssh_url_to_repo) {
|
||||
this.ssh_url_to_repo = ssh_url_to_repo;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getHttp_url_to_repo() {
|
||||
return http_url_to_repo;
|
||||
}
|
||||
|
||||
public void setHttp_url_to_repo(String http_url_to_repo) {
|
||||
this.http_url_to_repo = http_url_to_repo;
|
||||
}
|
||||
|
||||
public String getWeb_url() {
|
||||
return web_url;
|
||||
}
|
||||
|
||||
public void setWeb_url(String web_url) {
|
||||
this.web_url = web_url;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName_with_namespace() {
|
||||
return name_with_namespace;
|
||||
}
|
||||
|
||||
public void setName_with_namespace(String name_with_namespace) {
|
||||
this.name_with_namespace = name_with_namespace;
|
||||
}
|
||||
|
||||
public String getPath_with_namespace() {
|
||||
return path_with_namespace;
|
||||
}
|
||||
|
||||
public void setPath_with_namespace(String path_with_namespace) {
|
||||
this.path_with_namespace = path_with_namespace;
|
||||
}
|
||||
|
||||
public String getIssues_enabled() {
|
||||
return issues_enabled;
|
||||
}
|
||||
|
||||
public void setIssues_enabled(String issues_enabled) {
|
||||
this.issues_enabled = issues_enabled;
|
||||
}
|
||||
|
||||
public String getMerge_requests_enabled() {
|
||||
return merge_requests_enabled;
|
||||
}
|
||||
|
||||
public void setMerge_requests_enabled(String merge_requests_enabled) {
|
||||
this.merge_requests_enabled = merge_requests_enabled;
|
||||
}
|
||||
|
||||
public String getWiki_enabled() {
|
||||
return wiki_enabled;
|
||||
}
|
||||
|
||||
public void setWiki_enabled(String wiki_enabled) {
|
||||
this.wiki_enabled = wiki_enabled;
|
||||
}
|
||||
|
||||
public String getJobs_enabled() {
|
||||
return jobs_enabled;
|
||||
}
|
||||
|
||||
public void setJobs_enabled(String jobs_enabled) {
|
||||
this.jobs_enabled = jobs_enabled;
|
||||
}
|
||||
|
||||
public String getSnippets_enabled() {
|
||||
return snippets_enabled;
|
||||
}
|
||||
|
||||
public void setSnippets_enabled(String snippets_enabled) {
|
||||
this.snippets_enabled = snippets_enabled;
|
||||
}
|
||||
|
||||
public String getCreated_at() {
|
||||
return created_at;
|
||||
}
|
||||
|
||||
public void setCreated_at(String created_at) {
|
||||
this.created_at = created_at;
|
||||
}
|
||||
|
||||
public String getLast_activity_at() {
|
||||
return last_activity_at;
|
||||
}
|
||||
|
||||
public void setLast_activity_at(String last_activity_at) {
|
||||
this.last_activity_at = last_activity_at;
|
||||
}
|
||||
|
||||
public String getShared_runners_enabled() {
|
||||
return shared_runners_enabled;
|
||||
}
|
||||
|
||||
public void setShared_runners_enabled(String shared_runners_enabled) {
|
||||
this.shared_runners_enabled = shared_runners_enabled;
|
||||
}
|
||||
|
||||
public String getCreator_id() {
|
||||
return creator_id;
|
||||
}
|
||||
|
||||
public void setCreator_id(String creator_id) {
|
||||
this.creator_id = creator_id;
|
||||
}
|
||||
|
||||
public Object getNamespace() {
|
||||
return namespace;
|
||||
}
|
||||
|
||||
public void setNamespace(Object namespace) {
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public void setAvatar_url(String avatar_url) {
|
||||
this.avatar_url = avatar_url;
|
||||
}
|
||||
|
||||
public String getStar_count() {
|
||||
return star_count;
|
||||
}
|
||||
|
||||
public void setStar_count(String star_count) {
|
||||
this.star_count = star_count;
|
||||
}
|
||||
|
||||
public String getForks_count() {
|
||||
return forks_count;
|
||||
}
|
||||
|
||||
public void setForks_count(String forks_count) {
|
||||
this.forks_count = forks_count;
|
||||
}
|
||||
|
||||
public String getOpen_issues_count() {
|
||||
return open_issues_count;
|
||||
}
|
||||
|
||||
public void setOpen_issues_count(String open_issues_count) {
|
||||
this.open_issues_count = open_issues_count;
|
||||
}
|
||||
|
||||
public String getPublic_jobs() {
|
||||
return public_jobs;
|
||||
}
|
||||
|
||||
public void setPublic_jobs(String public_jobs) {
|
||||
this.public_jobs = public_jobs;
|
||||
}
|
||||
|
||||
public String getRequest_access_enabled() {
|
||||
return request_access_enabled;
|
||||
}
|
||||
|
||||
public void setRequest_access_enabled(String request_access_enabled) {
|
||||
this.request_access_enabled = request_access_enabled;
|
||||
}
|
||||
|
||||
public Object getTag_list() {
|
||||
return tag_list;
|
||||
}
|
||||
|
||||
public void setTag_list(Object tag_list) {
|
||||
this.tag_list = tag_list;
|
||||
}
|
||||
|
||||
public Object getShared_with_groups() {
|
||||
return shared_with_groups;
|
||||
}
|
||||
|
||||
public void setShared_with_groups(Object shared_with_groups) {
|
||||
this.shared_with_groups = shared_with_groups;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package org.chtijbug.drools.console.service.model.gitlab;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProjectMoveResponse {
|
||||
private String id;
|
||||
private String name;
|
||||
private String path;
|
||||
private String description;
|
||||
private String visibility_level;
|
||||
private String lfs_enabled;
|
||||
private String avatar_url;
|
||||
private String web_url;
|
||||
|
||||
private String request_access_enabled;
|
||||
|
||||
private String full_name;
|
||||
|
||||
private String full_path;
|
||||
private List<GroupElementResponse> projects;
|
||||
private List<GroupElementResponse> shared_projects;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getVisibility_level() {
|
||||
return visibility_level;
|
||||
}
|
||||
|
||||
public void setVisibility_level(String visibility_level) {
|
||||
this.visibility_level = visibility_level;
|
||||
}
|
||||
|
||||
public String getLfs_enabled() {
|
||||
return lfs_enabled;
|
||||
}
|
||||
|
||||
public void setLfs_enabled(String lfs_enabled) {
|
||||
this.lfs_enabled = lfs_enabled;
|
||||
}
|
||||
|
||||
public String getAvatar_url() {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public void setAvatar_url(String avatar_url) {
|
||||
this.avatar_url = avatar_url;
|
||||
}
|
||||
|
||||
public String getWeb_url() {
|
||||
return web_url;
|
||||
}
|
||||
|
||||
public void setWeb_url(String web_url) {
|
||||
this.web_url = web_url;
|
||||
}
|
||||
|
||||
public String getRequest_access_enabled() {
|
||||
return request_access_enabled;
|
||||
}
|
||||
|
||||
public void setRequest_access_enabled(String request_access_enabled) {
|
||||
this.request_access_enabled = request_access_enabled;
|
||||
}
|
||||
|
||||
public String getFull_name() {
|
||||
return full_name;
|
||||
}
|
||||
|
||||
public void setFull_name(String full_name) {
|
||||
this.full_name = full_name;
|
||||
}
|
||||
|
||||
public String getFull_path() {
|
||||
return full_path;
|
||||
}
|
||||
|
||||
public void setFull_path(String full_path) {
|
||||
this.full_path = full_path;
|
||||
}
|
||||
|
||||
public List<GroupElementResponse> getProjects() {
|
||||
return projects;
|
||||
}
|
||||
|
||||
public void setProjects(List<GroupElementResponse> projects) {
|
||||
this.projects = projects;
|
||||
}
|
||||
|
||||
public List<GroupElementResponse> getShared_projects() {
|
||||
return shared_projects;
|
||||
}
|
||||
|
||||
public void setShared_projects(List<GroupElementResponse> shared_projects) {
|
||||
this.shared_projects = shared_projects;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package org.chtijbug.drools.console.service.model.jenkins;
|
||||
|
||||
public class JenkinsConfigurationData {
|
||||
|
||||
private String url;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
private String credentials;
|
||||
|
||||
private String nexusName;
|
||||
|
||||
private String nexusUrl;
|
||||
|
||||
private String jdkVersion;
|
||||
|
||||
private String groupName;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getCredentials() {
|
||||
return credentials;
|
||||
}
|
||||
|
||||
public void setCredentials(String credentials) {
|
||||
this.credentials = credentials;
|
||||
}
|
||||
|
||||
public String getNexusName() {
|
||||
return nexusName;
|
||||
}
|
||||
|
||||
public void setNexusName(String nexusName) {
|
||||
this.nexusName = nexusName;
|
||||
}
|
||||
|
||||
public String getNexusUrl() {
|
||||
return nexusUrl;
|
||||
}
|
||||
|
||||
public void setNexusUrl(String nexusUrl) {
|
||||
this.nexusUrl = nexusUrl;
|
||||
}
|
||||
|
||||
public String getJdkVersion() {
|
||||
return jdkVersion;
|
||||
}
|
||||
|
||||
public void setJdkVersion(String jdkVersion) {
|
||||
this.jdkVersion = jdkVersion;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class GitRepository {
|
||||
private String name;
|
||||
private String description;
|
||||
private String userName;
|
||||
private String password;
|
||||
private String requestType;
|
||||
private String gitURL;
|
||||
private String organizationalUnitName;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRequestType() {
|
||||
return requestType;
|
||||
}
|
||||
|
||||
public void setRequestType(String requestType) {
|
||||
this.requestType = requestType;
|
||||
}
|
||||
|
||||
public String getGitURL() {
|
||||
return gitURL;
|
||||
}
|
||||
|
||||
public void setGitURL(String gitURL) {
|
||||
this.gitURL = gitURL;
|
||||
}
|
||||
|
||||
public String getOrganizationalUnitName() {
|
||||
return organizationalUnitName;
|
||||
}
|
||||
|
||||
public void setOrganizationalUnitName(String organizationalUnitName) {
|
||||
this.organizationalUnitName = organizationalUnitName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class GitRepositoryResponse {
|
||||
private String jobId;
|
||||
private String status;
|
||||
private GitRepository repository;
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public GitRepository getRepository() {
|
||||
return repository;
|
||||
}
|
||||
|
||||
public void setRepository(GitRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class JobStatus {
|
||||
private String status;
|
||||
private String jobId;
|
||||
private String spaceName;
|
||||
private String projectName;
|
||||
private String result;
|
||||
private Date lastModified;
|
||||
private String detailedResult[];
|
||||
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getSpaceName() {
|
||||
return spaceName;
|
||||
}
|
||||
|
||||
public void setSpaceName(String spaceName) {
|
||||
this.spaceName = spaceName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public Date getLastModified() {
|
||||
return lastModified;
|
||||
}
|
||||
|
||||
public void setLastModified(Date lastModified) {
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
|
||||
public String[] getDetailedResult() {
|
||||
return detailedResult;
|
||||
}
|
||||
|
||||
public void setDetailedResult(String[] detailedResult) {
|
||||
this.detailedResult = detailedResult;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class KieConfigurationData {
|
||||
|
||||
private String kiewbUrl;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String password;
|
||||
|
||||
private String kieserverUrl;
|
||||
|
||||
private String kieserverUserName;
|
||||
|
||||
private String kieserverPassword;
|
||||
|
||||
public String getKiewbUrl() {
|
||||
return kiewbUrl;
|
||||
}
|
||||
|
||||
public void setKiewbUrl(String kiewbUrl) {
|
||||
this.kiewbUrl = kiewbUrl;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getKieserverUrl() {
|
||||
return kieserverUrl;
|
||||
}
|
||||
|
||||
public void setKieserverUrl(String kieserverUrl) {
|
||||
this.kieserverUrl = kieserverUrl;
|
||||
}
|
||||
|
||||
public String getKieserverUserName() {
|
||||
return kieserverUserName;
|
||||
}
|
||||
|
||||
public void setKieserverUserName(String kieserverUserName) {
|
||||
this.kieserverUserName = kieserverUserName;
|
||||
}
|
||||
|
||||
public String getKieserverPassword() {
|
||||
return kieserverPassword;
|
||||
}
|
||||
|
||||
public void setKieserverPassword(String kieserverPassword) {
|
||||
this.kieserverPassword = kieserverPassword;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class KieContainerContent {
|
||||
@JsonProperty("container-id")
|
||||
private String containerId;
|
||||
|
||||
private String status;
|
||||
|
||||
@JsonProperty("release-id")
|
||||
private ReleaseDefinition releaseId;
|
||||
|
||||
@JsonProperty("resolved-release-id")
|
||||
private ReleaseDefinition resolvedReleaseId;
|
||||
|
||||
public String getContainerId() {
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setContainerId(String containerId) {
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public ReleaseDefinition getReleaseId() {
|
||||
return releaseId;
|
||||
}
|
||||
|
||||
public void setReleaseId(ReleaseDefinition releaseId) {
|
||||
this.releaseId = releaseId;
|
||||
}
|
||||
|
||||
public ReleaseDefinition getResolvedReleaseId() {
|
||||
return resolvedReleaseId;
|
||||
}
|
||||
|
||||
public void setResolvedReleaseId(ReleaseDefinition resolvedReleaseId) {
|
||||
this.resolvedReleaseId = resolvedReleaseId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class KieContainerInfo {
|
||||
|
||||
private String containerId;
|
||||
private String artifactId;
|
||||
private String groupId;
|
||||
private String version;
|
||||
private String containerAlias;
|
||||
|
||||
public String getContainerId() {
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setContainerId(String containerId) {
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public String getArtifactId() {
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
public void setArtifactId(String artifactId) {
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getContainerAlias() {
|
||||
return containerAlias;
|
||||
}
|
||||
|
||||
public void setContainerAlias(String containerAlias) {
|
||||
this.containerAlias = containerAlias;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class KieContainerRequest {
|
||||
@JsonProperty("container-id")
|
||||
private String containerId;
|
||||
@JsonProperty("release-id")
|
||||
private ReleaseDefinition releaseId;
|
||||
|
||||
public String getContainerId() {
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setContainerId(String containerId) {
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public ReleaseDefinition getReleaseId() {
|
||||
return releaseId;
|
||||
}
|
||||
|
||||
public void setReleaseId(ReleaseDefinition releaseId) {
|
||||
this.releaseId = releaseId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class KieProject {
|
||||
private String groupId;
|
||||
private String version;
|
||||
private String name;
|
||||
private String description;
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class KieProjectResponse {
|
||||
private String jobId;
|
||||
private String status;
|
||||
private String repositoryName;
|
||||
private String projectName;
|
||||
private String projectGroupId;
|
||||
private String projectVersion;
|
||||
private String description;
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRepositoryName() {
|
||||
return repositoryName;
|
||||
}
|
||||
|
||||
public void setRepositoryName(String repositoryName) {
|
||||
this.repositoryName = repositoryName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getProjectGroupId() {
|
||||
return projectGroupId;
|
||||
}
|
||||
|
||||
public void setProjectGroupId(String projectGroupId) {
|
||||
this.projectGroupId = projectGroupId;
|
||||
}
|
||||
|
||||
public String getProjectVersion() {
|
||||
return projectVersion;
|
||||
}
|
||||
|
||||
public void setProjectVersion(String projectVersion) {
|
||||
this.projectVersion = projectVersion;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class KieServerJobStatus {
|
||||
private String type;
|
||||
private String msg;
|
||||
private String result;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ReleaseDefinition {
|
||||
|
||||
@JsonProperty("artifact-id")
|
||||
private String artifactId;
|
||||
@JsonProperty("group-id")
|
||||
private String groupId;
|
||||
private String version;
|
||||
|
||||
public String getArtifactId() {
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
public void setArtifactId(String artifactId) {
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Space {
|
||||
private String name;
|
||||
private String description;
|
||||
private List<SpaceProject> projects = new ArrayList<>();
|
||||
private String owner;
|
||||
private String defaultGroupId;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<SpaceProject> getProjects() {
|
||||
return projects;
|
||||
}
|
||||
|
||||
public void setProjects(List<SpaceProject> projects) {
|
||||
this.projects = projects;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getDefaultGroupId() {
|
||||
return defaultGroupId;
|
||||
}
|
||||
|
||||
public void setDefaultGroupId(String defaultGroupId) {
|
||||
this.defaultGroupId = defaultGroupId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SpaceProject {
|
||||
private String name;
|
||||
private String spaceName;
|
||||
private String groupId;
|
||||
private String version;
|
||||
private String description;
|
||||
private List<SpaceProjectURI> publicURIs = new ArrayList<>();
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSpaceName() {
|
||||
return spaceName;
|
||||
}
|
||||
|
||||
public void setSpaceName(String spaceName) {
|
||||
this.spaceName = spaceName;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<SpaceProjectURI> getPublicURIs() {
|
||||
return publicURIs;
|
||||
}
|
||||
|
||||
public void setPublicURIs(List<SpaceProjectURI> publicURIs) {
|
||||
this.publicURIs = publicURIs;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package org.chtijbug.drools.console.service.model.kie;
|
||||
|
||||
public class SpaceProjectURI {
|
||||
private String protocol;
|
||||
private String uri;
|
||||
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
|
||||
public void setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
public void setUri(String uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.service.util;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
|
||||
public class AppContext {
|
||||
|
||||
private static ApplicationContext ctx;
|
||||
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return ctx;
|
||||
}
|
||||
|
||||
public static void setApplicationContext(ApplicationContext applicationContext) {
|
||||
ctx = applicationContext;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.service.util;
|
||||
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
|
||||
public class ApplicationContextProvider implements ApplicationContextAware {
|
||||
|
||||
public void setApplicationContext(ApplicationContext ctx) throws BeansException {
|
||||
AppContext.setApplicationContext(ctx);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
server.port=${port:8200}
|
||||
kie-wb.baseurl=http://localhost:8080/kie-wb/rest
|
||||
kie-wb.username=admin
|
||||
kie-wb.password=admin
|
||||
kie-wb.kieserverUrl=http://localhost:10080/kie-server/services/rest/server
|
||||
kie-wb.kieserverUserName=kieserver
|
||||
kie-wb.kieserverPassword=kieserver1!
|
||||
gitlab.url=https://gitlab.pymma-software.com/api/v4
|
||||
gitlab.token=S7nUESqC3Mb_yyYNqsod
|
||||
gitlab.group=EPO
|
||||
gitlab.baseurl=git@gitlab.pymma-software.com:epo
|
||||
#jenkins.url=https://jenkins.pymma-software.com/
|
||||
jenkins.url=https://jenkins.pymma-software.com/
|
||||
jenkins.username=jbpmuser
|
||||
jenkins.password=jbpmuser
|
||||
jenkins.credentials=bb6b3297-2f7d-4431-a997-1ee185283c7f
|
||||
jenkins.nexusUrl=https://nexus.pymma-software.com/nexus/
|
||||
jenkins.nexusName=pymma-snapshot
|
||||
jenkins.jdkVersion=jdk18
|
||||
jenkins.group=EPO
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-4.1.xsd">
|
||||
<context:component-scan base-package="org.chtijbug.drools.console"/>
|
||||
<bean class="org.chtijbug.drools.console.service.model.kie.KieConfigurationData">
|
||||
<property name="userName" value="${kie-wb.username}"/>
|
||||
<property name="password" value="${kie-wb.password}"/>
|
||||
<property name="kiewbUrl" value="${kie-wb.baseurl}"/>
|
||||
<property name="kieserverUserName" value="${kie-wb.kieserverUserName}"/>
|
||||
<property name="kieserverPassword" value="${kie-wb.kieserverPassword}"/>
|
||||
<property name="kieserverUrl" value="${kie-wb.kieserverUrl}"/>
|
||||
|
||||
</bean>
|
||||
<!--bean class="org.chtijbug.drools.console.service.model.gitlab.GitLabConfigurationData">
|
||||
<property name="url" value="${gitlab.url}"/>
|
||||
<property name="token" value="${gitlab.token}"/>
|
||||
<property name="groupName" value="${gitlab.group}"/>
|
||||
<property name="baseUrl" value="${gitlab.baseurl}"/>
|
||||
</bean>
|
||||
<bean class="org.chtijbug.drools.console.service.model.jenkins.JenkinsConfigurationData">
|
||||
<property name="url" value="${jenkins.url}"/>
|
||||
<property name="username" value="${jenkins.username}"/>
|
||||
<property name="password" value="${jenkins.password}"/>
|
||||
<property name="credentials" value="${jenkins.credentials}"/>
|
||||
<property name="nexusName" value="${jenkins.nexusName}"/>
|
||||
<property name="nexusUrl" value="${jenkins.nexusUrl}"/>
|
||||
<property name="jdkVersion" value="${jenkins.jdkVersion}"/>
|
||||
<property name="groupName" value="${jenkins.group}"/>
|
||||
</bean-->
|
||||
<bean name="applicationContext" class="org.chtijbug.drools.console.service.util.ApplicationContextProvider"/>
|
||||
|
||||
</beans>
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue