-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from qianmoQ/feature-dev
添加多个构建工具
- Loading branch information
Showing
36 changed files
with
957 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM eclipse-temurin:8-jdk-focal | ||
|
||
MAINTAINER qianmoQ "[email protected]" | ||
|
||
RUN mkdir -p /opt/app | ||
ADD dist/infosphere-release.tar.gz /opt/app/ | ||
WORKDIR /opt/app/infosphere | ||
|
||
EXPOSE 9099 | ||
|
||
# run it | ||
ENTRYPOINT ["sh", "./bin/debug.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<assembly> | ||
<id>release</id> | ||
|
||
<formats> | ||
<format>tar.gz</format> | ||
</formats> | ||
|
||
<includeBaseDirectory>true</includeBaseDirectory> | ||
|
||
<dependencySets> | ||
<dependencySet> | ||
<useProjectArtifact>false</useProjectArtifact> | ||
<outputDirectory>lib</outputDirectory> | ||
<unpack>false</unpack> | ||
</dependencySet> | ||
</dependencySets> | ||
|
||
<fileSets> | ||
<fileSet> | ||
<directory>${project.parent.basedir}/configure/etc/bin</directory> | ||
<outputDirectory>bin</outputDirectory> | ||
<fileMode>0755</fileMode> | ||
<lineEnding>unix</lineEnding> | ||
<filtered>true</filtered> | ||
</fileSet> | ||
<fileSet> | ||
<directory>${project.parent.basedir}/configure/etc/conf</directory> | ||
<outputDirectory>configure</outputDirectory> | ||
<includes> | ||
<include>**/*.xml</include> | ||
<include>**/*.properties</include> | ||
<include>**/*.yml</include> | ||
<include>**/*.json</include> | ||
<include>**/*.yaml</include> | ||
<include>**/*.conf</include> | ||
</includes> | ||
<filtered>true</filtered> | ||
</fileSet> | ||
<fileSet> | ||
<directory>target</directory> | ||
<outputDirectory>lib</outputDirectory> | ||
<includes> | ||
<include>*.jar</include> | ||
</includes> | ||
<excludes> | ||
<exclude>*-javadoc.jar</exclude> | ||
<exclude>*-sources.jar</exclude> | ||
</excludes> | ||
</fileSet> | ||
<fileSet> | ||
<directory>.</directory> | ||
<outputDirectory>docs</outputDirectory> | ||
<includes> | ||
<include>*.md</include> | ||
</includes> | ||
<fileMode>0644</fileMode> | ||
</fileSet> | ||
<fileSet> | ||
<directory>docs</directory> | ||
<outputDirectory>docs</outputDirectory> | ||
<fileMode>0644</fileMode> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE module PUBLIC | ||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN" | ||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | ||
<module name="Checker"> | ||
<module name="FileTabCharacter" /> | ||
<module name="NewlineAtEndOfFile"> | ||
<property name="lineSeparator" value="lf" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="\r" /> | ||
<property name="message" value="Line contains carriage return" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value=" \n" /> | ||
<property name="message" value="Line has trailing whitespace" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="\{\n\n" /> | ||
<property name="message" value="{ Do not contain empty newlines after parentheses" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="\n\n\s*\}" /> | ||
<property name="message" value="} Do not contain empty newlines before parentheses" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="\n\n\n" /> | ||
<property name="message" value="Multiple consecutive blank lines" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="\n\n\Z" /> | ||
<property name="message" value="The end of the file must contain a blank line" /> | ||
</module> | ||
<module name="RegexpSingleline"> | ||
<property name="format" value="Preconditions\.checkNotNull" /> | ||
<property name="message" value="Use java.util.Objects.requireNonNull instead of Preconditions\.checkNotNull" /> | ||
</module> | ||
<module name="RegexpSingleline"> | ||
<property name="format" value="^([^i]|i[^m]|im[^p]|imp[^o]|impo[^r]|impor[^t]|import[^ ]).*Objects\.requireNonNull" /> | ||
<property name="message" value="Objects.requireNonNull only use by static imports" /> | ||
</module> | ||
<module name="RegexpSingleline"> | ||
<property name="format" value="Ints\.checkedCast" /> | ||
<property name="message" value="Use Math.toIntExact instead of Ints.checkedCast" /> | ||
</module> | ||
<module name="RegexpSingleline"> | ||
<property name="format" value="^([^i]|i[^m]|im[^p]|imp[^o]|impo[^r]|impor[^t]|import[^ ]).*Math\.toIntExact" /> | ||
<property name="message" value="Math.toIntExact should only be used with static imports" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="^[ \t]*import com.google.common.base.MoreObjects;$" /> | ||
<property name="message" value="com.google.common.base.MoreObjects should only be used with static imports" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="^[ \t]*import org.testng.Assert;$" /> | ||
<property name="message" value="org.testng.Assert should only be used with static imports" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="^[ \t]*import org.jetbrains.annotations.NotNull;$" /> | ||
<property name="message" value="Not null is the default for the codebase and should not be annotated" /> | ||
</module> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="^[ \t]*import org.jetbrains.annotations.Nullable;$" /> | ||
<property name="message" value="Use javax.annotation.Nullable instead of org.jetbrains.annotations.Nullable" /> | ||
</module> | ||
|
||
<module name="SuppressWarningsFilter" /> | ||
<module name="TreeWalker"> | ||
<module name="SuppressWarningsHolder" /> | ||
<module name="EmptyBlock"> | ||
<property name="option" value="text" /> | ||
<property name="tokens" value=" | ||
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF, | ||
LITERAL_FOR, LITERAL_TRY, LITERAL_WHILE, INSTANCE_INIT, STATIC_INIT" /> | ||
</module> | ||
<module name="EmptyStatement" /> | ||
<module name="EmptyForInitializerPad" /> | ||
<module name="EmptyForIteratorPad"> | ||
<property name="option" value="space" /> | ||
</module> | ||
<module name="MethodParamPad"> | ||
<property name="allowLineBreaks" value="true" /> | ||
<property name="option" value="nospace" /> | ||
</module> | ||
<module name="ParenPad" /> | ||
<module name="TypecastParenPad" /> | ||
<module name="NeedBraces" /> | ||
<module name="LeftCurly"> | ||
<property name="option" value="nl" /> | ||
<property name="tokens" value="CLASS_DEF, CTOR_DEF, INTERFACE_DEF, METHOD_DEF" /> | ||
</module> | ||
<module name="LeftCurly"> | ||
<property name="option" value="eol" /> | ||
<property name="tokens" value=" | ||
LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, | ||
LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE" /> | ||
</module> | ||
<module name="RightCurly"> | ||
<property name="option" value="alone" /> | ||
</module> | ||
<module name="GenericWhitespace" /> | ||
<module name="WhitespaceAfter" /> | ||
<module name="NoWhitespaceBefore" /> | ||
|
||
<module name="UpperEll" /> | ||
<module name="DefaultComesLast" /> | ||
<module name="ArrayTypeStyle" /> | ||
<module name="MultipleVariableDeclarations" /> | ||
<module name="ModifierOrder" /> | ||
<module name="OneStatementPerLine" /> | ||
<module name="StringLiteralEquality" /> | ||
<module name="MutableException" /> | ||
<module name="EqualsHashCode" /> | ||
<module name="InnerAssignment" /> | ||
<module name="InterfaceIsType" /> | ||
<module name="HideUtilityClassConstructor" /> | ||
|
||
<module name="MemberName" /> | ||
<module name="LocalVariableName"> | ||
<property name="format" value="^[a-z][a-zA-Z0-9]*$|^_[a-z][a-zA-Z0-9]*$" /> | ||
</module> | ||
<module name="LocalFinalVariableName" /> | ||
<module name="TypeName" /> | ||
<module name="PackageName" /> | ||
<module name="ParameterName" /> | ||
<module name="StaticVariableName"> | ||
<property name="format" value="^[a-z][a-zA-Z0-9]*$|^[A-Z0-9]*$" /> | ||
</module> | ||
<module name="ClassTypeParameterName"> | ||
<property name="format" value="^[A-Z][0-9]?$" /> | ||
</module> | ||
<module name="MethodTypeParameterName"> | ||
<property name="format" value="^[A-Z][0-9]?$" /> | ||
</module> | ||
|
||
<module name="AvoidStarImport" /> | ||
<module name="RedundantImport" /> | ||
<module name="UnusedImports" /> | ||
<module name="ImportOrder"> | ||
<property name="groups" value="*,javax,java" /> | ||
<property name="separated" value="true" /> | ||
<property name="option" value="bottom" /> | ||
<property name="sortStaticImportsAlphabetically" value="true" /> | ||
</module> | ||
|
||
<module name="WhitespaceAround"> | ||
<property name="allowEmptyConstructors" value="true" /> | ||
<property name="allowEmptyMethods" value="true" /> | ||
<property name="ignoreEnhancedForColon" value="false" /> | ||
<property name="tokens" value=" | ||
ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, | ||
BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LE, | ||
LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, | ||
LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, | ||
LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, | ||
LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, | ||
PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, | ||
STAR, STAR_ASSIGN, TYPE_EXTENSION_AND" /> | ||
</module> | ||
|
||
<module name="IllegalToken"> | ||
<property name="tokens" value="LITERAL_ASSERT" /> | ||
</module> | ||
|
||
<module name="IllegalImport"> | ||
<property name="illegalPkgs" value=" | ||
jersey.repackaged, | ||
jdk.nashorn.internal, | ||
jdk.internal" /> | ||
</module> | ||
</module> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
################################### Basic configure ################################# | ||
server.port=9099 | ||
# Fixed serialized data missing for 8 hours | ||
spring.jackson.time-zone=GMT+8 | ||
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss | ||
# infosphere security management configuration | ||
infosphere.security.secret=InfoSphereSecretKey | ||
infosphere.security.expiration=86400000 | ||
spring.main.allow-bean-definition-overriding=true | ||
server.servlet.encoding.force=true | ||
server.servlet.encoding.charset=UTF-8 | ||
#logging.level.org.hibernate.SQL=debug | ||
#logging.level.org.hibernate.type.descriptor.sql=trace | ||
|
||
################################ Database configure ################################# | ||
spring.datasource.url=jdbc:mysql://mysql:3306/infosphere?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&useOldAliasMetadataBehavior=true&jdbcCompliantTruncation=false&allowPublicKeyRetrieval=true | ||
spring.datasource.username=root | ||
spring.datasource.password=12345678 | ||
|
||
################################ Web viewer ################################# | ||
infosphere.viewer.prefix=viewer/ | ||
infosphere.viewer.suffix=.html | ||
infosphere.viewer.cache=false | ||
infosphere.viewer.mode=HTML5 | ||
infosphere.viewer.encoding=UTF-8 | ||
infosphere.viewer.static-location=classpath:/static/ | ||
infosphere.viewer.static-relative-location=/static/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/sh | ||
|
||
HOME=$(pwd) | ||
JAVA_HOME=${JAVA_HOME:-/opt/jdk} | ||
APPLICATION_NAME='org.devlive.infosphere.server.InfoSphere' | ||
APPLICATION_PID= | ||
|
||
check_java_version() { | ||
local java_version=$("$JAVA_HOME"/bin/java -version 2>&1 | awk -F '"' '/version/ {print $2}') | ||
local major_version=$(echo "$java_version" | awk -F. '{print $1}') | ||
if [ "$major_version" != "1" ] && [ "$major_version" != "11" ]; then | ||
printf "错误:不支持 Java 版本 [ %s ]。请使用 Java 1.8 或 11。\n" "$java_version" | ||
exit 1 | ||
fi | ||
} | ||
|
||
job_before_echo_basic() { | ||
printf "\n\t运行环境详情\n" | ||
printf "============================================\n" | ||
printf "运行时 InfoSphere 主目录 | %s\n" "$HOME" | ||
printf "运行时 java 主目录 | %s\n" "$JAVA_HOME" | ||
printf "运行时应用程序名称 | %s\n" "$APPLICATION_NAME" | ||
printf "============================================\n\n" | ||
} | ||
|
||
job_before_apply_server() { | ||
APPLICATION_PID=$(pgrep -f "$APPLICATION_NAME" | awk '{print $1}') | ||
} | ||
|
||
job_runner_checker_server() { | ||
printf "\n\t服务运行状态检查 \n" | ||
printf "============================================\n" | ||
job_before_apply_server | ||
printf "服务运行进程 | %s\n" "$APPLICATION_PID" | ||
if test -z "$APPLICATION_PID"; then | ||
printf "服务运行状态 | %s\n" "已停止" | ||
printf "============================================\n\n" | ||
else | ||
printf "服务运行状态 | %s\n" "运行中" | ||
printf "============================================\n\n" | ||
exit | ||
fi | ||
} | ||
|
||
job_runner_start_server() { | ||
printf "\n\t启动服务 \n" | ||
printf "============================================\n" | ||
printf "启动服务 | %s\n" "$APPLICATION_NAME" | ||
cd "$HOME" | ||
nohup "$JAVA_HOME"/bin/java -cp "$HOME/lib/*" "$APPLICATION_NAME" \ | ||
--spring.config.location="$HOME/configure/" | ||
sleep 5 | ||
job_before_apply_server | ||
if test -z "$APPLICATION_PID"; then | ||
printf "服务启动失败 | %s\n" | ||
else | ||
echo "$APPLICATION_PID" >pid | ||
printf "服务启动成功 | %s\n" | ||
fi | ||
printf "============================================\n\n" | ||
} | ||
|
||
check_java_version | ||
job_before_echo_basic | ||
# shellcheck disable=SC2119 | ||
job_runner_checker_server | ||
job_runner_start_server | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
HOME=$(pwd) | ||
|
||
sh "$HOME"/bin/shutdown.sh | ||
sh "$HOME"/bin/startup.sh |
Oops, something went wrong.