The purpose of software-defined networking (SDN) is, in simple terms, to centralize parts of the otherwise decentralized internet. The primary use case of this library is to help serve java code to end-users from multiple independent developers through git and GitLab. This library does not serve as an SDN controller in itself, but provides the tools to create one.
This library is meant to be used with GitLab as it provides tools that lets us fully automate the developer side of the process. Here is a quick overview of how this library is meant to be used:
Setup:
The program defines a GitLab access token with GitLabAPI.setAccessToken(). GitLab access tokens can be generated here. Make sure the token has the "api" scope.
- A developer requests a repository to push their code to. The program uses
GitLabAPI.createSubgroup()to create a subgroup inside a bigger, SDN-wide group on GitLab. - The program uses
GitLab.addMemberToGroup()to add the developer to the newly created subgroup, presumably withMaintaineraccess. - The developer creates a new project in their subgroup, and pushes their code to it.
- The developer requests their code to be compiled. This can either happen automatically or after an SDN maintainer has reviewed the code.
- After code review, or on-demand by developer, the repository is cloned by the program with
VCS.cleanCloneAuthedRepo()(assuming the repository requires authentication, if not useVCS.cleanCloneRepo()) - The program compiles the repository code with
Compiler.compile()and packages the compiled code withCompiler.createJar(). - The program can alternatively compile the repository with
MavenWrapper.executeMavenCommand(), if the repository is a maven project - The code is further processed if necessary and distributed by the program to end-users.
- Get accessible groups and projects
- Get members of a group or project
- Create subgroups (a subgroup is a group within a group)
- Add members to groups and projects
Note: a subgroup is effectively a group, (almost) all group-related API also works on subgroups.
- Clone a repository to a directory over HTTP(S)
- Compile java source code from a directory to .class files in another directory
- Package .class files from a directory to .jar archive
- Supports any maven plugin (verify, clean, package, install) - useful for compilation
- More GitLab actions