diff options
Diffstat (limited to 'rulemgt-standalone')
-rw-r--r-- | rulemgt-standalone/pom.xml | 36 | ||||
-rw-r--r-- | rulemgt-standalone/src/main/assembly/bin/run.sh | 8 |
2 files changed, 41 insertions, 3 deletions
diff --git a/rulemgt-standalone/pom.xml b/rulemgt-standalone/pom.xml index 58d91e9..e68d6d7 100644 --- a/rulemgt-standalone/pom.xml +++ b/rulemgt-standalone/pom.xml @@ -30,6 +30,12 @@ <name>holmes-rulemgt/holmes-rulemgt-standalone</name> <packaging>pom</packaging> + <properties> + <holmes.rule.project.version>${project.version}</holmes.rule.project.version> + <maven.build.timestamp.format>yyMMdd-HHmmss</maven.build.timestamp.format> + <build.number>${maven.build.timestamp}</build.number> + </properties> + <build> <plugins> <plugin> @@ -191,6 +197,32 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source> + println project.properties['holmes.rule.project.version']; + def versionArray; + if ( project.properties['holmes.rule.project.version'] != null ) { + versionArray = project.properties['holmes.rule.project.version'].split('-'); + } + + project.properties['project.docker.latesttag.version']=versionArray[0] + "-STAGING-latest"; + + println 'New Tag for docker:' + + project.properties['project.docker.latesttag.version']; + </source> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> @@ -213,7 +245,9 @@ <dockerFileDir>${basedir}/target/version/</dockerFileDir> <dockerFile>${basedir}/target/version/Dockerfile</dockerFile> <tags> - <tag>${project.version}-STAGING-latest</tag> + <tag>${project.version}</tag> + <tag>${project.version}-STAGING-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> </tags> </build> </image> diff --git a/rulemgt-standalone/src/main/assembly/bin/run.sh b/rulemgt-standalone/src/main/assembly/bin/run.sh index bad26c7..592f85d 100644 --- a/rulemgt-standalone/src/main/assembly/bin/run.sh +++ b/rulemgt-standalone/src/main/assembly/bin/run.sh @@ -39,8 +39,12 @@ sed -i "s|msbServerAddr:.*|msbServerAddr: http://$MSB_ADDR|" "$main_path/conf/ru export SERVICE_IP=`hostname -i` echo SERVICE_IP=${SERVICE_IP} -if [ ${TESTING}==1 ]; then - export HOSTNAME=${SERVICE_IP}:9101 +if [ ! -z ${TESTING} ] && [ ${TESTING} == 1 ]; then + if [ ! -z ${HOST_IP} ]; then + export HOSTNAME=${HOST_IP}:9101 + else + export HOSTNAME=${SERVICE_IP}:9101 + fi fi |