Commit 39fb6a84 by Jason Song

Merge pull request #152 from yiming187/update

update assembly
parents f5898737 471c659a
...@@ -2,10 +2,20 @@ ...@@ -2,10 +2,20 @@
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-adminservice</id>
<formats> <formats>
<format>zip</format> <format>zip</format>
</formats> </formats>
<includeBaseDirectory>false</includeBaseDirectory> <includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>*:apollo-buildtools:*</include>
<include>*:apollo-adminervice:*</include>
</includes>
<sources>
<includeModuleDirectory>false</includeModuleDirectory>
<fileSets> <fileSets>
<!--scripts --> <!--scripts -->
<fileSet> <fileSet>
...@@ -31,4 +41,7 @@ ...@@ -31,4 +41,7 @@
<fileMode>0444</fileMode> <fileMode>0444</fileMode>
</fileSet> </fileSet>
</fileSets> </fileSets>
</sources>
</moduleSet>
</moduleSets>
</assembly> </assembly>
\ No newline at end of file
package com.ctrip.apollo.common.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ctrip.apollo.Apollo;
import com.ctrip.framework.foundation.Foundation;
@RestController
@RequestMapping(path = "/apollo")
public class ApolloInfoController {
@RequestMapping("app")
public String getApp() {
return Foundation.app().toString();
}
@RequestMapping("web")
public String getEnv() {
return Foundation.web().toString();
}
@RequestMapping("net")
public String getNet() {
return Foundation.net().toString();
}
@RequestMapping("server")
public String getServer() {
return Foundation.server().toString();
}
@RequestMapping("version")
public String getVersion() {
return Apollo.VERSION;
}
}
...@@ -2,10 +2,20 @@ ...@@ -2,10 +2,20 @@
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-configservice</id>
<formats> <formats>
<format>zip</format> <format>zip</format>
</formats> </formats>
<includeBaseDirectory>false</includeBaseDirectory> <includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>*:apollo-buildtools:*</include>
<include>*:apollo-configservice:*</include>
</includes>
<sources>
<includeModuleDirectory>false</includeModuleDirectory>
<fileSets> <fileSets>
<!--scripts --> <!--scripts -->
<fileSet> <fileSet>
...@@ -31,4 +41,7 @@ ...@@ -31,4 +41,7 @@
<fileMode>0444</fileMode> <fileMode>0444</fileMode>
</fileSet> </fileSet>
</fileSets> </fileSets>
</sources>
</moduleSet>
</moduleSets>
</assembly> </assembly>
\ No newline at end of file
#!/bin/bash
# directories
SYSOUT_LOG=$LOG_PATH/sysout.log
mkdir -p $LOG_PATH
PID_PATH_NAME=$SERVICE_NAME".pid"
case $1 in
start)
echo "Starting $SERVICE_NAME ..."
if [ ! -f $PID_PATH_NAME ]; then
nohup java -jar $PATH_TO_JAR /tmp 2>> $SYSOUT_LOG >> $SYSOUT_LOG &
echo $! > $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is already running ..."
fi
;;
stop)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stopping ..."
kill $PID;
echo "$SERVICE_NAME stopped ..."
rm $PID_PATH_NAME
else
echo "$SERVICE_NAME is not running ..."
fi
;;
restart)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stopping ...";
kill $PID;
echo "$SERVICE_NAME stopped ...";
rm $PID_PATH_NAME
echo "$SERVICE_NAME starting ..."
nohup java -jar $PATH_TO_JAR /tmp 2>> $SYSOUT_LOG >> $SYSOUT_LOG &
echo $! > $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is not running ..."
fi
;;
esac
exit 0
\ No newline at end of file
...@@ -4,5 +4,6 @@ package com.ctrip.apollo; ...@@ -4,5 +4,6 @@ package com.ctrip.apollo;
* @author Jason Song(song_s@ctrip.com) * @author Jason Song(song_s@ctrip.com)
*/ */
public class Apollo { public class Apollo {
public final static String VERSION = "java-0.0.1-SNAPSHOT"; public final static String VERSION =
"java-" + Apollo.class.getPackage().getImplementationVersion();
} }
...@@ -2,10 +2,20 @@ ...@@ -2,10 +2,20 @@
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-portal</id>
<formats> <formats>
<format>zip</format> <format>zip</format>
</formats> </formats>
<includeBaseDirectory>false</includeBaseDirectory> <includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>*:apollo-buildtools:*</include>
<include>*:apollo-portal:*</include>
</includes>
<sources>
<includeModuleDirectory>false</includeModuleDirectory>
<fileSets> <fileSets>
<!--scripts --> <!--scripts -->
<fileSet> <fileSet>
...@@ -31,4 +41,7 @@ ...@@ -31,4 +41,7 @@
<fileMode>0444</fileMode> <fileMode>0444</fileMode>
</fileSet> </fileSet>
</fileSets> </fileSets>
</sources>
</moduleSet>
</moduleSets>
</assembly> </assembly>
\ No newline at end of file
#!/bin/bash
# directories
SYSOUT_LOG=$LOG_PATH/sysout.log
mkdir -p $LOG_PATH
PID_PATH_NAME=$SERVICE_NAME".pid"
case $1 in
start)
echo "Starting $SERVICE_NAME ..."
if [ ! -f $PID_PATH_NAME ]; then
nohup java -jar $PATH_TO_JAR /tmp 2>> $SYSOUT_LOG >> $SYSOUT_LOG &
echo $! > $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is already running ..."
fi
;;
stop)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stopping ..."
kill $PID;
echo "$SERVICE_NAME stopped ..."
rm $PID_PATH_NAME
else
echo "$SERVICE_NAME is not running ..."
fi
;;
restart)
if [ -f $PID_PATH_NAME ]; then
PID=$(cat $PID_PATH_NAME);
echo "$SERVICE_NAME stopping ...";
kill $PID;
echo "$SERVICE_NAME stopped ...";
rm $PID_PATH_NAME
echo "$SERVICE_NAME starting ..."
nohup java -jar $PATH_TO_JAR /tmp 2>> $SYSOUT_LOG >> $SYSOUT_LOG &
echo $! > $PID_PATH_NAME
echo "$SERVICE_NAME started ..."
else
echo "$SERVICE_NAME is not running ..."
fi
;;
esac
exit 0
\ No newline at end of file
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
<jetty.version>9.2.15.v20160210</jetty.version> <jetty.version>9.2.15.v20160210</jetty.version>
<github.global.server>github</github.global.server> <github.global.server>github</github.global.server>
<github.global.oauth2Token>${env.GITHUB_OAUTH_TOKEN}</github.global.oauth2Token> <github.global.oauth2Token>${env.GITHUB_OAUTH_TOKEN}</github.global.oauth2Token>
<github.path></github.path>
</properties> </properties>
<modules> <modules>
...@@ -250,7 +249,7 @@ ...@@ -250,7 +249,7 @@
<dependency> <dependency>
<groupId>com.ctrip.apollo</groupId> <groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-buildtools</artifactId> <artifactId>apollo-buildtools</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>${project.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<configuration> <configuration>
...@@ -283,6 +282,16 @@ ...@@ -283,6 +282,16 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
...@@ -294,6 +303,22 @@ ...@@ -294,6 +303,22 @@
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId> <artifactId>findbugs-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment