Add packaging config file and shell script
This commit is contained in:
parent
24a8ea32eb
commit
ae36838b5c
|
|
@ -0,0 +1,17 @@
|
|||
@echo off
|
||||
|
||||
setlocal
|
||||
set COLLECOTR_PROCESS_TITLE=Skywalking-Collector
|
||||
set COLLECTOR_BASE_PATH=%~dp0%..
|
||||
set COLLECTOR_RUNTIME_OPTIONS="-Xms256M -Xmx512M"
|
||||
|
||||
if ""%JAVA_HOME%"" == """" (
|
||||
set _EXECJAVA=java
|
||||
) else (
|
||||
set _EXECJAVA="%JAVA_HOME%"/bin/java
|
||||
)
|
||||
|
||||
start /MIN "%COLLECOTR_PROCESS_TITLE%" %_EXECJAVA% "%COLLECTOR_RUNTIME_OPTIONS%" -jar "%COLLECTOR_BASE_PATH%"/libs/skywalking-collector.jar &
|
||||
echo Collector started successfully!
|
||||
|
||||
endlocal
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PRG="$0"
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
[ -z "$COLLECTOR_HOME" ] && COLLECTOR_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
|
||||
|
||||
COLLECTOR_LOGS_DIR="${COLLECTOR_HOME}/logs"
|
||||
COLLECTOR_RUNTIME_OPTIONS=" -Xms256M -Xmx512M"
|
||||
|
||||
if [ ! -d "${COLLECTOR_HOME}/logs" ]; then
|
||||
mkdir -p "${COLLECTOR_LOGS_DIR}"
|
||||
fi
|
||||
|
||||
_RUNJAVA=${JAVA_HOME}/bin/java
|
||||
[ -z "$JAVA_HOME" ] && _RUNJAVA=`java`
|
||||
|
||||
echo "Starting collector...."
|
||||
eval exec "\"$_RUNJAVA\" ${COLLECTOR_RUNTIME_OPTIONS} -jar ${COLLECTOR_HOME}/libs/skywalking-collector.jar \
|
||||
2>${COLLECTOR_LOGS_DIR}/collector.log 1> /dev/null &"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
sleep 1
|
||||
echo "Collector started successfully!"
|
||||
else
|
||||
echo "Collector started failure!"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@echo off
|
||||
|
||||
setlocal
|
||||
call "%~dp0"\collector-service.bat start
|
||||
endlocal
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PRG="$0"
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
EXECUTABLE=collector-service.sh
|
||||
|
||||
exec "$PRGDIR"/"$EXECUTABLE" start
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
<properties>
|
||||
<jetty.version>9.4.2.v20170220</jetty.version>
|
||||
<main.class>com.a.eye.skywalking.collector.worker.CollectorBootStartUp</main.class>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
@ -46,6 +47,12 @@
|
|||
<groupId>com.a.eye</groupId>
|
||||
<artifactId>skywalking-sniffer-mock</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
@ -54,4 +61,49 @@
|
|||
<version>RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>skywalking-collector</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>*.xml</exclude>
|
||||
<exclude>*.config</exclude>
|
||||
</excludes>
|
||||
<archive>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifestEntries>
|
||||
<Class-Path>config/</Class-Path>
|
||||
</manifestEntries>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>${main.class}</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id></id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<scope>compile</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/bin</directory>
|
||||
<outputDirectory>/bin</outputDirectory>
|
||||
<includes>
|
||||
<include>*.sh</include>
|
||||
<include>*.bat</include>
|
||||
</includes>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>collector.config</include>
|
||||
<include>log4j2.xml</include>
|
||||
</includes>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<includes>
|
||||
<include>${build.finalName}.jar</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
Loading…
Reference in New Issue