Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d0b2b09

Browse files
committed
new: merge with latest LC
1 parent acc402f commit d0b2b09

File tree

33 files changed

+340
-229
lines changed

33 files changed

+340
-229
lines changed

deploy/docker/Dockerfile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
FROM maven:3.9-eclipse-temurin-17 AS build-api-service
55

66
# Clone and build lowcoder-plugin-api
7-
RUN mkdir -p /build/plugin-api \
8-
&& cd /build/plugin-api \
9-
&& git clone https://[email protected]/Lowcoder-Pro/lowcoder-plugin-api.git .
10-
7+
COPY ./lowcoder-plugin-api /build/plugin-api
118
WORKDIR /build/plugin-api
129
RUN --mount=type=cache,target=/root/.m2 mvn -f pom.xml clean install -DskipTests
1310

@@ -16,15 +13,7 @@ WORKDIR /lowcoder-server
1613
RUN --mount=type=cache,target=/root/.m2 mvn -f pom.xml clean package -DskipTests
1714

1815
# Create required folder structure
19-
RUN mkdir -p /lowcoder/api-service/plugins /lowcoder/api-service/config /lowcoder/api-service/logs /lowcoder/plugins
20-
21-
# Define lowcoder main jar and plugin jars
22-
ARG JAR_FILE=/lowcoder-server/lowcoder-server/target/lowcoder-server-*.jar
23-
ARG PLUGIN_JARS=/lowcoder-server/lowcoder-plugins/*/target/*.jar
24-
25-
# Copy lowcoder server application and plugins
26-
RUN cp ${JAR_FILE} /lowcoder/api-service/server.jar \
27-
&& cp ${PLUGIN_JARS} /lowcoder/api-service/plugins/
16+
RUN mkdir -p /lowcoder/api-service/config /lowcoder/api-service/logs /lowcoder/plugins
2817

2918
# Copy lowcoder server configuration
3019
COPY server/api-service/lowcoder-server/src/main/resources/selfhost/ce/application.yml /lowcoder/api-service/config/
@@ -52,6 +41,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends gosu \
5241
# Copy lowcoder server configuration
5342
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder/api-service /lowcoder/api-service
5443

44+
# Copy lowcoder api service app, dependencies and libs
45+
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/app /lowcoder/api-service/app
46+
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/dependencies /lowcoder/api-service/dependencies
47+
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/libs /lowcoder/api-service/libs
48+
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/plugins /lowcoder/api-service/plugins
49+
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/set-classpath.sh /lowcoder/api-service/set-classpath.sh
50+
5551
EXPOSE 8080
5652
CMD [ "sh" , "/lowcoder/api-service/entrypoint.sh" ]
5753

@@ -212,7 +208,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-instal
212208
# Add lowcoder api-service
213209
COPY --chown=lowcoder:lowcoder --from=lowcoder-ce-api-service /lowcoder/api-service /lowcoder/api-service
214210
RUN mkdir -p /lowcoder/plugins/ && chown lowcoder:lowcoder /lowcoder/plugins/
215-
COPY --chown=lowcoder:lowcoder enterprise-plugin-0.0.1.jar /lowcoder/plugins/enterprise-plugin-0.0.1.jar
216211

217212
# Add lowcoder node-service
218213
COPY --chown=lowcoder:lowcoder --from=lowcoder-ce-node-service /lowcoder/node-service /lowcoder/node-service

deploy/docker/api-service/entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ ${JAVA_HOME}/bin/java -version
2727
echo
2828

2929
cd /lowcoder/api-service
30+
source set-classpath.sh
31+
3032
exec gosu ${USER_ID}:${GROUP_ID} ${JAVA_HOME}/bin/java \
3133
-Djava.util.prefs.userRoot=/tmp \
3234
-Djava.security.egd=file:/dev/./urandom \
3335
-Dhttps.protocols=TLSv1.1,TLSv1.2 \
3436
-Dlog4j2.formatMsgNoLookups=true \
3537
-Dspring.config.location="file:///lowcoder/api-service/config/application.yml,file:///lowcoder/api-service/config/application-selfhost.yml" \
3638
--add-opens java.base/java.nio=ALL-UNNAMED \
39+
-cp "${LOWCODER_CLASSPATH:=.}" \
3740
${JAVA_OPTS} \
38-
-jar "${APP_JAR}" --spring.webflux.base-path=${CONTEXT_PATH} ${CUSTOM_APP_PROPERTIES}
41+
org.lowcoder.api.ServerApplication --spring.webflux.base-path=${CONTEXT_PATH} ${CUSTOM_APP_PROPERTIES}
3942

server/api-service/.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ dependency-reduced-pom.xml
2323
.run/**
2424
logs/**
2525
tmp/**
26-
/openblocks-server/logs/
2726

27+
# Ignore plugin.properties which are generated dynamically
28+
**/plugin.properties
2829

2930
# to ignore the node_modeules folder
3031
node_modules
@@ -34,5 +35,4 @@ package-lock.json
3435
# test coverage
3536
coverage-summary.json
3637
app/client/cypress/locators/Widgets.json
37-
/openblocks-domain/logs/
38-
application-lowcoder.yml
38+
application-lowcoder.yml
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.lowcoder</groupId>
7+
<artifactId>lowcoder-root</artifactId>
8+
<version>${revision}</version>
9+
</parent>
10+
11+
<artifactId>distribution</artifactId>
12+
<packaging>pom</packaging>
13+
14+
<properties>
15+
<assembly.lib.directory>${project.build.directory}/dependencies</assembly.lib.directory>
16+
</properties>
17+
18+
19+
<!-- Dependency added here only to make sure this module is built after
20+
everything alse was built -->
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.lowcoder</groupId>
24+
<artifactId>lowcoder-sdk</artifactId>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.lowcoder</groupId>
28+
<artifactId>lowcoder-infra</artifactId>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.lowcoder</groupId>
32+
<artifactId>lowcoder-domain</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.lowcoder</groupId>
36+
<artifactId>lowcoder-server</artifactId>
37+
</dependency>
38+
</dependencies>
39+
40+
<build>
41+
<finalName>lowcoder-api-service</finalName>
42+
<plugins>
43+
<plugin>
44+
<groupId>org.apache.maven.plugins</groupId>
45+
<artifactId>maven-dependency-plugin</artifactId>
46+
<executions>
47+
<execution>
48+
<id>copy-dependencies</id>
49+
<phase>prepare-package</phase>
50+
<goals>
51+
<goal>copy-dependencies</goal>
52+
</goals>
53+
<configuration>
54+
<outputDirectory>${assembly.lib.directory}</outputDirectory>
55+
<overWriteReleases>false</overWriteReleases>
56+
<overWriteSnapshots>false</overWriteSnapshots>
57+
<overWriteIfNewer>true</overWriteIfNewer>
58+
<prependGroupId>true</prependGroupId>
59+
</configuration>
60+
</execution>
61+
</executions>
62+
</plugin>
63+
<plugin>
64+
<artifactId>maven-assembly-plugin</artifactId>
65+
<executions>
66+
<execution>
67+
<id>distro-assembly</id>
68+
<phase>package</phase>
69+
<goals>
70+
<goal>single</goal>
71+
</goals>
72+
<configuration>
73+
<attach>false</attach>
74+
<descriptors>
75+
<descriptor>src/assembly/bin.xml</descriptor>
76+
</descriptors>
77+
</configuration>
78+
</execution>
79+
</executions>
80+
</plugin>
81+
</plugins>
82+
</build>
83+
84+
</project>
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd">
4+
<id>bin</id>
5+
<formats>
6+
<format>dir</format>
7+
</formats>
8+
<includeBaseDirectory>false</includeBaseDirectory>
9+
10+
<files>
11+
<file>
12+
<source>src/assembly/set-classpath.sh</source>
13+
<outputDirectory></outputDirectory>
14+
</file>
15+
</files>
16+
<fileSets>
17+
<fileSet>
18+
<directory>${assembly.lib.directory}</directory>
19+
<outputDirectory>dependencies</outputDirectory>
20+
<excludes>
21+
<exclude>${project.groupId}:*</exclude>
22+
</excludes>
23+
</fileSet>
24+
</fileSets>
25+
26+
<moduleSets>
27+
<!-- Main lowcoder API server application -->
28+
<moduleSet>
29+
<useAllReactorProjects>true</useAllReactorProjects>
30+
<includes>
31+
<include>org.lowcoder:lowcoder-server</include>
32+
</includes>
33+
<binaries>
34+
<outputDirectory>app</outputDirectory>
35+
<includeDependencies>false</includeDependencies>
36+
<unpack>false</unpack>
37+
</binaries>
38+
</moduleSet>
39+
40+
<!-- Lowcoder API server dependencies -->
41+
<moduleSet>
42+
<useAllReactorProjects>true</useAllReactorProjects>
43+
<includes>
44+
<include>org.lowcoder:lowcoder-domain</include>
45+
<include>org.lowcoder:lowcoder-infra</include>
46+
<include>org.lowcoder:lowcoder-sdk</include>
47+
</includes>
48+
<binaries>
49+
<outputDirectory>libs</outputDirectory>
50+
<includeDependencies>false</includeDependencies>
51+
<unpack>false</unpack>
52+
</binaries>
53+
</moduleSet>
54+
55+
<!-- Lowcoder plugins -->
56+
<moduleSet>
57+
<useAllReactorProjects>true</useAllReactorProjects>
58+
<includeSubModules>true</includeSubModules>
59+
<includes>
60+
<include>org.lowcoder:*Plugin</include>
61+
</includes>
62+
<excludes>
63+
<exclude>org.lowcoder:sqlBasedPlugin</exclude>
64+
</excludes>
65+
<binaries>
66+
<outputDirectory>plugins</outputDirectory>
67+
<includeDependencies>false</includeDependencies>
68+
<unpack>false</unpack>
69+
</binaries>
70+
</moduleSet>
71+
</moduleSets>
72+
</assembly>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
#
4+
# Set lowcoder api service classpath for use in startup script
5+
#
6+
export LOWCODER_CLASSPATH="`find libs/ dependencies/ app/ -type f -name "*.jar" | tr '\n' ':' | sed -e 's/:$//'`"
7+
8+
#
9+
# Example usage:
10+
#
11+
# java -cp "${LOWCODER_CLASSPATH}" org.lowcoder.api.ServerApplication

server/api-service/lowcoder-domain/pom.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@
186186
<dependency>
187187
<groupId>es.moki.ratelimitj</groupId>
188188
<artifactId>ratelimitj-redis</artifactId>
189+
<exclusions>
190+
<exclusion>
191+
<groupId>io.lettuce</groupId>
192+
<artifactId>lettuce-core</artifactId>
193+
</exclusion>
194+
</exclusions>
189195
</dependency>
190196

191197
<dependency>
@@ -242,6 +248,18 @@
242248

243249
<build>
244250
<plugins>
251+
<plugin>
252+
<groupId>org.apache.maven.plugins</groupId>
253+
<artifactId>maven-compiler-plugin</artifactId>
254+
<configuration>
255+
<source>${java.version}</source>
256+
<target>${java.version}</target>
257+
<compilerArgs>
258+
<arg>-parameters</arg>
259+
</compilerArgs>
260+
</configuration>
261+
</plugin>
262+
245263
<plugin>
246264
<groupId>com.mysema.maven</groupId>
247265
<artifactId>apt-maven-plugin</artifactId>
@@ -268,9 +286,9 @@
268286

269287
<properties>
270288
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
289+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
290+
271291
<java.version>17</java.version>
272-
<maven.compiler.source>17</maven.compiler.source>
273-
<maven.compiler.target>17</maven.compiler.target>
274292
</properties>
275293

276294
<dependencyManagement>

server/api-service/lowcoder-infra/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@
138138

139139
<properties>
140140
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
141+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
142+
141143
<java.version>17</java.version>
144+
142145
<maven.compiler.source>17</maven.compiler.source>
143146
<maven.compiler.target>17</maven.compiler.target>
144147
</properties>

server/api-service/lowcoder-plugins/clickHousePlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/elasticSearchPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/googleSheetsPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/graphqlPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/lowcoderApiPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/mongoPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/mssqlPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/mysqlPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/oraclePlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

server/api-service/lowcoder-plugins/oraclePlugin/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414

1515
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
18+
1619
<maven.compiler.source>17</maven.compiler.source>
1720
<maven.compiler.target>17</maven.compiler.target>
1821

server/api-service/lowcoder-plugins/postgresPlugin/plugin.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)