-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add package command #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ build | |
# Intellij | ||
.idea | ||
.cq | ||
|
||
dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM --platform=$BUILDPLATFORM gradle:8.3-jdk20 as build | ||
ARG GITHUB_ACTOR | ||
ARG GITHUB_TOKEN | ||
|
||
WORKDIR /code | ||
|
||
COPY . . | ||
|
||
RUN gradle jar --no-daemon | ||
|
||
FROM eclipse-temurin:20-jre | ||
|
||
COPY --from=build /code/lib/build/libs/*.jar /app/app.jar | ||
|
||
EXPOSE 7777 | ||
|
||
ENV _JAVA_OPTIONS="--add-opens=java.base/java.nio=ALL-UNNAMED" | ||
|
||
ENTRYPOINT ["java", "-jar", "/app/app.jar"] | ||
|
||
CMD [ "serve", "--address", "localhost:7777", "--log-format", "json", "--log-level", "info" ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# MemDB Plugin | ||
|
||
Test docs for the MemDB plugin. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.cloudquery.plugin; | ||
|
||
public enum BuildArch { | ||
AMD64("amd64"), | ||
ARM64("arm64"); | ||
|
||
public final String arch; | ||
|
||
private BuildArch(String arch) { | ||
this.arch = arch; | ||
} | ||
|
||
public String toString() { | ||
return this.arch; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.cloudquery.plugin; | ||
|
||
public enum BuildOS { | ||
Windows("windows"), | ||
Linux("linux"), | ||
Darwin("darwin"); | ||
|
||
public final String os; | ||
|
||
private BuildOS(String os) { | ||
this.os = os; | ||
} | ||
|
||
public String toString() { | ||
return this.os; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.cloudquery.plugin; | ||
|
||
import lombok.Getter; | ||
import lombok.NonNull; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public class BuildTarget { | ||
@NonNull protected final BuildOS os; | ||
@NonNull protected final BuildArch arch; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,21 @@ | |
public abstract class Plugin { | ||
@NonNull protected final String name; | ||
@NonNull protected final String version; | ||
|
||
@Setter protected Logger logger; | ||
@Setter protected String jsonSchema; | ||
|
||
@Setter protected String team; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't set these to |
||
@Setter protected PluginKind kind; | ||
@Setter protected String dockerfile = "Dockerfile"; | ||
|
||
@Setter | ||
protected BuildTarget[] buildTargets = | ||
new BuildTarget[] { | ||
new BuildTarget(BuildOS.Linux, BuildArch.ARM64), | ||
new BuildTarget(BuildOS.Linux, BuildArch.AMD64), | ||
}; | ||
|
||
protected ClientMeta client; | ||
|
||
public void init(String spec, NewClientOptions options) throws Exception { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.cloudquery.plugin; | ||
|
||
public enum PluginKind { | ||
Source("source"), | ||
Destination("destination"); | ||
|
||
public final String kind; | ||
|
||
private PluginKind(String kind) { | ||
this.kind = kind; | ||
} | ||
|
||
public String toString() { | ||
return this.kind; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
import io.cloudquery.schema.Column.ColumnBuilder; | ||
import io.cloudquery.transformers.TransformerException; | ||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
@@ -32,7 +31,7 @@ public interface Transform { | |
public static List<Table> flattenTables(List<Table> tables) { | ||
Map<String, Table> flattenMap = new LinkedHashMap<>(); | ||
for (Table table : tables) { | ||
Table newTable = table.toBuilder().relations(Collections.emptyList()).build(); | ||
Table newTable = table.toBuilder().build(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Emptying the relations makes it so the |
||
flattenMap.put(newTable.name, newTable); | ||
for (Table child : flattenTables(table.getRelations())) { | ||
flattenMap.put(child.name, child); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used in the Dockerfile to build the MemDB plugin