Skip to content

Commit

Permalink
include distribution functionality for single-service
Browse files Browse the repository at this point in the history
  • Loading branch information
lahirujayathilake committed Jan 10, 2023
1 parent 744dc0c commit 2d98cc1
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<directory>src/main/resources/distribution/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>application.properties</include>
<include>resource-service-application.properties</include>
<include>log4j2.xml</include>
<include>applicationContext.xml</include>
<include>resources.json</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<directory>src/main/resources/distribution/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>application.properties</include>
<include>secret-service-application.properties</include>
<include>log4j2.xml</include>
<include>applicationContext.xml</include>
<include>secrets.json</include>
Expand Down
46 changes: 46 additions & 0 deletions single-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,50 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly.plugin}</version>
<executions>
<execution>
<id>mft-single-service-distribution-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<tarLongFileMode>posix</tarLongFileMode>
<finalName>${single.service.dist.name}</finalName>
<descriptors>
<descriptor>src/main/assembly/single-service-bin-assembly.xml</descriptor>
</descriptors>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludes>
<exclude>**/*.properties</exclude>
<exclude>**/*.xml</exclude>
<exclude>**/*.sh</exclude>
<exclude>**/*.json</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<single.service.dist.name>Single-Service-0.01</single.service.dist.name>
<maven.assembly.plugin>3.1.1</maven.assembly.plugin>
</properties>

</project>
102 changes: 102 additions & 0 deletions single-service/src/main/assembly/single-service-bin-assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE assembly [
<!ELEMENT assembly (id|includeBaseDirectory|baseDirectory|formats|fileSets|dependencySets)*>
<!ELEMENT id (#PCDATA)>
<!ELEMENT includeBaseDirectory (#PCDATA)>
<!ELEMENT baseDirectory (#PCDATA)>
<!ELEMENT formats (format)*>
<!ELEMENT format (#PCDATA)>
<!ELEMENT fileSets (fileSet)*>
<!ELEMENT fileSet (directory|outputDirectory|fileMode|includes)*>
<!ELEMENT directory (#PCDATA)>
<!ELEMENT outputDirectory (#PCDATA)>
<!ELEMENT includes (include)*>
<!ELEMENT include (#PCDATA)>
<!ELEMENT dependencySets (dependencySet)*>
<!ELEMENT dependencySet (outputDirectory|outputFileNameMapping|includes)*>
]>
<assembly>
<id>bin</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>${single.service.dist.name}</baseDirectory>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>

<fileSets>
<fileSet>
<directory>src/main/resources/distribution/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>777</fileMode>
<includes>
<include>*.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/resources/distribution/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>application.properties</include>
<include>log4j2.xml</include>
<include>applicationContext.xml</include>
<include>resources.json</include>
</includes>
</fileSet>
<fileSet>
<directory>./</directory>
<outputDirectory>logs</outputDirectory>
<excludes>
<exclude>*/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>../services/resource-service/server/src/main/resources/distribution/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>resource-service-application.properties</include></includes>
</fileSet>
<fileSet>
<directory>../services/secret-service/server/src/main/resources/distribution/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>secret-service-application.properties</include></includes>
</fileSet>
</fileSets>

<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

spring.main.allow-bean-definition-overriding=true
53 changes: 53 additions & 0 deletions single-service/src/main/resources/distribution/conf/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<Configuration status="WARN">

<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d [%t] %-5p %c{30} %X - %m%n"/>
</Console>
<RollingFile name="RollingFileAppender" fileName="../logs/airavata.log"
filePattern="logs/single-service/${date:yyyy-MM}/airavata-log-%d{MM-dd-yyyy}-%i.log.gz">
<PatternLayout>
<Pattern>%d [%t] %-5p %c{30} %X - %m%n</Pattern>
</PatternLayout>
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="50 MB" />
</Policies>
<DefaultRolloverStrategy max="20" />
</RollingFile>
</Appenders>
<Loggers>
<logger name="org.apache.helix" level="WARN"/>
<logger name="org.apache.zookeeper" level="ERROR"/>
<logger name="org.apache.airavata" level="INFO"/>
<logger name="org.hibernate" level="ERROR"/>
<logger name="org.apache.coyote.http11" level="ERROR"/>
<Root level="INFO">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingFileAppender"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit 2d98cc1

Please sign in to comment.