Skip to content

Commit

Permalink
Merge pull request #1 from WHK01/multiproject
Browse files Browse the repository at this point in the history
Multiproject support for multi projects and project inheritance via YAML configuration
  • Loading branch information
pmannion2 authored Feb 2, 2024
2 parents 6adcfd2 + 95c7e3d commit 3ba4dc7
Show file tree
Hide file tree
Showing 10 changed files with 493 additions and 241 deletions.
Binary file removed git-build/target/Git-signed.modl
Binary file not shown.
Binary file removed git-build/target/Git-unsigned.modl
Binary file not shown.
Binary file removed git-build/target/git-build-1.0.3.jar
Binary file not shown.
17 changes: 17 additions & 0 deletions git-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@
<artifactId>org.eclipse.jgit.ssh.jsch</artifactId>
<version>6.5.0.202303070854-r</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.29</version> <!-- Use the latest version available -->
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,108 +5,73 @@
import java.nio.file.Files;
import java.nio.file.Path;

import lombok.Getter;
import lombok.Setter;
import org.jetbrains.annotations.Nullable;

public class GitCommissioningConfig {

// Existing fields and methods
@Getter
@Setter
private String repoURI;
@Getter
@Setter
private String repoBranch;
@Getter
@Setter
private String ignitionProjectName;
@Getter
@Setter
private String ignitionUserName;
@Getter
@Setter
private boolean ignitionProjectInheritable;
@Getter
@Setter
@Nullable
// This field is nullable
private String ignitionProjectParentName;
@Getter
@Setter
private String userName;
@Getter
@Setter
private String userPassword;
@Getter
@Setter
private String sshKey;
@Getter
@Setter
private String userEmail;

@Getter
@Setter
private boolean importImages = false;
@Getter
@Setter
private boolean importTags = false;
@Getter
@Setter
private boolean importThemes = false;

@Getter
@Setter
private String initDefaultBranch;

public String getRepoURI() {
return repoURI;
}

public void setRepoURI(String repoURI) {
this.repoURI = repoURI;
}

public String getRepoBranch() {
return repoBranch;
}

public void setRepoBranch(String repoBranch) {
this.repoBranch = repoBranch;
}

public String getIgnitionProjectName() {
return ignitionProjectName;
}

public void setIgnitionProjectName(String ignitionProjectName) {
this.ignitionProjectName = ignitionProjectName;
}

public String getUserName() {
return userName;
}

public void setUserName(String userName) {
this.userName = userName;
}

public String getUserPassword() {
return userPassword;
}

public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}

public String getUserEmail() {
return userEmail;
}
public void loadFromProjectConfig(ProjectConfig projectConfig) {

public void setUserEmail(String userEmail) {
this.userEmail = userEmail;
}

public String getIgnitionUserName() {
return ignitionUserName;
}

public void setIgnitionUserName(String ignitionUserName) {
this.ignitionUserName = ignitionUserName;
}

public boolean isImportImages() {
return importImages;
}

public void setImportImages(boolean importImages) {
this.importImages = importImages;
}

public boolean isImportTags() {
return importTags;
}

public void setImportTags(boolean importTags) {
this.importTags = importTags;
}

public boolean isImportThemes() {
return importThemes;
}

public void setImportThemes(boolean importThemes) {
this.importThemes = importThemes;
}

public String getSshKey() {
return sshKey;
}

public void setSshKey(String sshKey) {
this.sshKey = sshKey;
this.repoURI = projectConfig.getRepo_uri();
this.repoBranch = projectConfig.getRepo_branch();
this.ignitionProjectName = projectConfig.getIgnition_projectName();
this.ignitionUserName = projectConfig.getIgnition_userName();
this.ignitionProjectInheritable = projectConfig.getIgnition_inheritable();
this.ignitionProjectParentName = projectConfig.getIgnition_parentName();
this.userName = projectConfig.getUser_name();
this.userEmail = projectConfig.getUser_email();
this.userPassword = projectConfig.getUser_password();
this.importImages = projectConfig.getCommissioning_importImages();
this.importTags = projectConfig.getCommissioning_importTags();
this.importThemes = projectConfig.getCommissioning_importThemes();
this.initDefaultBranch = projectConfig.getInitDefaultBranch();
}

public void setSecretFromFilePath(Path filePath, boolean isSSHAuth) throws IOException {
Expand All @@ -119,12 +84,6 @@ public void setSecretFromFilePath(Path filePath, boolean isSSHAuth) throws IOExc
}
}
}
}

public String getInitDefaultBranch() {
return initDefaultBranch;
}

public void setInitDefaultBranch(String initDefaultBranch) {
this.initDefaultBranch = initDefaultBranch;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.axone_io.ignition.git.commissioning;

import lombok.Getter;
import lombok.Setter;
import org.jetbrains.annotations.Nullable;

public class ProjectConfig {
// Getters and setters
@lombok.Getter
@lombok.Setter
private String initDefaultBranch;

@Getter
@Setter
private String repo_uri;
@Getter
@Setter
private String repo_branch;
@Getter
@Setter
private String ignition_projectName;
@Getter
@Setter
private String ignition_userName;
@Getter
@Setter
private Boolean ignition_inheritable;
@Getter
@Setter
@Nullable
private String ignition_parentName;
@Getter
@Setter
private String user_name;
@Getter
@Setter
private String user_email;
@Getter
@Setter
private String user_password;
@Getter
@Setter
private Boolean commissioning_importThemes;
@Getter
@Setter
private Boolean commissioning_importTags;
@Getter
@Setter
private Boolean commissioning_importImages;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.axone_io.ignition.git.commissioning;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class ProjectConfigs {
private List<ProjectConfig> projects;
// Method to Add Project to Class
public void addProject(ProjectConfig projectConfig) {
if (this.projects == null) { this.projects = new java.util.ArrayList<ProjectConfig>();}
projects.add(projectConfig);
}
}
Loading

0 comments on commit 3ba4dc7

Please sign in to comment.