diff options
7 files changed, 209 insertions, 131 deletions
diff --git a/ms/cds-sdc-listener/application/pom.xml b/ms/cds-sdc-listener/application/pom.xml index c58bb130f..3f8e1a319 100644 --- a/ms/cds-sdc-listener/application/pom.xml +++ b/ms/cds-sdc-listener/application/pom.xml @@ -6,7 +6,8 @@ ~ proprietary to Bell Canada and are protected by trade secret or copyright law. ~ Unauthorized copying of this file, via any medium is strictly prohibited. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.onap.ccsdk.parent</groupId> @@ -18,11 +19,17 @@ <modelVersion>4.0.0</modelVersion> <artifactId>cds-sdc-listener-application</artifactId> <version>0.4.2-SNAPSHOT</version> - <name>CDS-SDC Listener Application </name> + <name>CDS-SDC Listener Application</name> <properties> <grpc.version>1.17.1</grpc.version> <protobuf.version>3.6.1</protobuf.version> + <image.name>onap/ccsdk-cds-sdc-listener</image.name> + <docker.push.phase>deploy</docker.push.phase> + <project.version>${parent.version}</project.version> + <!-- Start of Docker Related Properties --> + <docker.fabric.version>0.26.1</docker.fabric.version> + <ccsdk.project.version>${project.version}</ccsdk.project.version> </properties> <dependencies> @@ -106,7 +113,103 @@ </execution> </executions> </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <id>copy</id> + <phase>package</phase> + <configuration> + <target> + <echo>ANT TASK - copying Docker files</echo> + <copy todir="${basedir}/target/docker-stage" overwrite="true" flatten="true"> + <fileset dir="${basedir}/src/main/docker"> + <include name="Dockerfile"/> + <include name="start.sh"/> + </fileset> + <fileset dir="${basedir}/target"> + <include name="*.jar"/> + </fileset> + <fileset dir="${basedir}/src/main/resources/"> + <include name="application.yml"/> + </fileset> + </copy> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source>${basedir}/../../../TagVersion.groovy</source> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker.fabric.version}</version> + <inherited>false</inherited> + <configuration> + <images> + <image> + <name>${image.name}</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> + <tags> + <tag>${project.docker.latestminortag.version}</tag> + <tag>${project.docker.latestfulltag.version}</tag> + <tag>${project.docker.latesttagtimestamp.version}</tag> + </tags> + </build> + </image> + </images> + <verbose>true</verbose> + </configuration> + <executions> + <execution> + <id>generate-images</id> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>push-images</id> + <phase>${docker.push.phase}</phase> + <goals> + <goal>build</goal> + <goal>push</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + </project> diff --git a/ms/cds-sdc-listener/application/src/main/docker/Dockerfile b/ms/cds-sdc-listener/application/src/main/docker/Dockerfile new file mode 100644 index 000000000..062f65767 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/docker/Dockerfile @@ -0,0 +1,13 @@ +FROM openjdk:8-jdk-alpine + +ENV HTTP_PROXY ${HTTP_PROXY} +ENV HTTPS_PROXY ${HTTPS_PROXY} + +RUN mkdir -p /opt/app/onap/ /opt/app/onap/config +WORKDIR /opt/app/onap/ +COPY start.sh /opt/app/onap/ +COPY application.yml /opt/app/onap/config +RUN chmod 751 /opt/app/onap/start.sh +COPY cds-sdc-listener-application-0.4.2-SNAPSHOT.jar /opt/app/onap/cds-sdc-listener-distribution.jar +EXPOSE 9000 +ENTRYPOINT /opt/app/onap/start.sh diff --git a/ms/cds-sdc-listener/application/src/main/docker/docker-compose.yaml b/ms/cds-sdc-listener/application/src/main/docker/docker-compose.yaml new file mode 100644 index 000000000..1e7384744 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/docker/docker-compose.yaml @@ -0,0 +1,29 @@ +version: '3.3' + +services: + cds-sdc-listener: + image: onap/cdssdclistener:latest + container_name: cdssdclistener + restart: always + environment: + asdcAddress: localhost:8443 + messageBusAddress: localhost + sdcusername: vid + password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + pollingInterval: 15 + pollingTimeout: 15 + relevantArtifactTypes: TOSCA_CSAR + consumerGroup: cds-id-local + environmentName: AUTO + consumerId: cds-id-local + keyStorePassword: + keyStorePath: + activateServerTLSAuth: "false" + isUseHttpsWithDmaap: "false" + archivePath: /opt/app/onap/cds-sdc-listener/ + grpcAddress: localhost + grpcPort: 9111 + authHeader: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + #port needed by Liveness probe + healthcheckPort: "9000" + sprintWebListenerEnabled: "true" diff --git a/ms/cds-sdc-listener/application/src/main/docker/start.sh b/ms/cds-sdc-listener/application/src/main/docker/start.sh new file mode 100755 index 000000000..f24d15618 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/docker/start.sh @@ -0,0 +1,6 @@ +#!/bin/sh +extraArgs=$@ +java -jar /opt/app/onap/cds-sdc-listener-distribution.jar \ +-Dspring.config=/opt/app/onap/config/application.yml \ +-Djava.security.egd=file:/dev/./urandom \ +${extraArgs} diff --git a/ms/cds-sdc-listener/application/src/main/resources/application.yml b/ms/cds-sdc-listener/application/src/main/resources/application.yml index 0c2c60dca..b3f8443eb 100644 --- a/ms/cds-sdc-listener/application/src/main/resources/application.yml +++ b/ms/cds-sdc-listener/application/src/main/resources/application.yml @@ -1,27 +1,27 @@ listenerservice: - config: - asdcAddress: localhost:8443 - messageBusAddress: localhost - user: vid - password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - pollingInterval: 15 - pollingTimeout: 60 - relevantArtifactTypes: TOSCA_CSAR - consumerGroup: cds-id-local - environmentName: AUTO - consumerId: cds-id-local - keyStorePassword: - keyStorePath: - activateServerTLSAuth : false - isUseHttpsWithDmaap: false - archivePath: /opt/app/onap/cds-sdc-listener/ - grpcAddress: localhost - grpcPort: 9111 - authHeader: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + config: + asdcAddress: ${asdcAddress:localhost:8443} + messageBusAddress: ${messageBusAddress:localhost} + user: ${sdcusername:vid} + password: ${password:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} + pollingInterval: ${pollingInterval:15} + pollingTimeout: ${pollingTimeout:60} + relevantArtifactTypes: ${relevantArtifactTypes:TOSCA_CSAR} + consumerGroup: ${consumerGroup:cds-id-local} + environmentName: ${environmentName:AUTO} + consumerId: ${consumerId:cds-id-local} + keyStorePassword: ${keyStorePassword} + keyStorePath: ${keyStorePath} + activateServerTLSAuth : ${activateServerTLSAuth:false} + isUseHttpsWithDmaap: ${isUseHttpsWithDmaap:false} + archivePath: ${archivePath:/opt/app/onap/cds-sdc-listener/} + grpcAddress: ${grpcAddress:localhost} + grpcPort: ${grpcPort:9111} + authHeader: ${authHeader:Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==} #port needed by Liveness probe server: - port: 9000 + port: ${healthcheckPort:9000} #set spring.main.web-environment=false if you want to NOT to open a port for healthcheck. -#spring: -# main: -# web-environment: false
\ No newline at end of file +spring: + main: + web-environment: ${sprintWebListenerEnabled:true} diff --git a/ms/cds-sdc-listener/application/src/main/resources/logback.xml b/ms/cds-sdc-listener/application/src/main/resources/logback.xml new file mode 100644 index 000000000..b26cbcbe4 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/resources/logback.xml @@ -0,0 +1,33 @@ +<!-- +Copyright (C) 2019 Bell Canada + +Unless otherwise specified, all software contained herein is licensed +under the Apache License, Version 2.0 (the License); +you may not use this software 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> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> + </encoder> + </appender> + + <root level="info"> + <appender-ref ref="STDOUT"/> + </root> + + <logger name="org.springframework" level="info"/> + <logger name="org.springframework.web" level="info"/> + <logger name="org.onap.ccsdk.cds" level="info"/> + +</configuration> diff --git a/ms/cds-sdc-listener/distribution/pom.xml b/ms/cds-sdc-listener/distribution/pom.xml deleted file mode 100644 index 59e3824d7..000000000 --- a/ms/cds-sdc-listener/distribution/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Copyright (C) 2019 Bell Canada. All rights reserved. - ~ - ~ NOTICE: All the intellectual and technical concepts contained herein are - ~ proprietary to Bell Canada and are protected by trade secret or copyright law. - ~ Unauthorized copying of this file, via any medium is strictly prohibited. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>cds-sdc-listener</artifactId> - <groupId>org.onap.ccsdk.cds</groupId> - <version>0.4.2-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <groupId>org.onap.ccsdk.cds</groupId> - <artifactId>cds-sdc-listener-distribution</artifactId> - <name>CDS-SDC Listener Distribution</name> - - <properties> - <image.name>onap/ccsdk-cdssdclistener</image.name> - <docker.push.phase>deploy</docker.push.phase> - </properties> - - <build> - <plugins> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <version>2.6</version> - <executions> - <execution> - <id>copy-dockerfile</id> - <goals> - <goal>copy-resources</goal> - </goals> - <phase>validate</phase> - <configuration> - <outputDirectory>${basedir}/target/docker-stage</outputDirectory> - <resources> - <resource> - <directory>src/main/docker</directory> - <includes> - <include>*</include> - </includes> - <filtering>true</filtering> - </resource> - </resources> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>docker</id> - <build> - <plugins> - <plugin> - <!-- Maven plugin for managing docker images and containers --> - <groupId>io.fabric8</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>0.26.1</version> - <inherited>false</inherited> - <configuration> - <images> - <image> - <name>${image.name}</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-STAGING-${maven.build.timestamp}</tag> - </tags> - </build> - </image> - </images> - <verbose>true</verbose> - </configuration> - <executions> - <execution> - <id>generate-images</id> - <phase>package</phase> - <goals> - <goal>build</goal> - </goals> - </execution> - <execution> - <id>push-images</id> - <phase>${docker.push.phase}</phase> - <goals> - <goal>build</goal> - <goal>push</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> - -</project> |