diff options
Diffstat (limited to 'ms')
14 files changed, 740 insertions, 0 deletions
diff --git a/ms/cds-sdc-listener/application/pom.xml b/ms/cds-sdc-listener/application/pom.xml new file mode 100644 index 000000000..1df385fef --- /dev/null +++ b/ms/cds-sdc-listener/application/pom.xml @@ -0,0 +1,73 @@ +<?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> + <groupId>org.onap.ccsdk.parent</groupId> + <artifactId>spring-boot-1-starter-parent</artifactId> + <version>1.2.2-SNAPSHOT</version> + <relativePath/> + </parent> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.onap.ccsdk.apps</groupId> + <artifactId>cds-sdc-listener-application</artifactId> + <name>CDS-SDC Listener Application </name> + + <dependencies> + <!-- Spring boot --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-devtools</artifactId> + <optional>true</optional> + </dependency> + + <!-- SDC Distribution client dependency --> + <dependency> + <groupId>org.onap.sdc.sdc-distribution-client</groupId> + <artifactId>sdc-distribution-client</artifactId> + <version>1.3.0</version> + </dependency> + + <dependency> + <groupId>org.jmockit</groupId> + <artifactId>jmockit</artifactId> + <version>1.19</version> + <scope>test</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <executions> + <execution> + <id>repackage</id> + <goals> + <goal>repackage</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerApplication.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerApplication.java new file mode 100644 index 000000000..3bd34fb08 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerApplication.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.EnableConfigurationProperties; + +@SpringBootApplication +@EnableConfigurationProperties(CdsSdcListenerConfiguration.class) +public class CdsSdcListenerApplication { + public static void main(String[] args) { + SpringApplication.run(CdsSdcListenerApplication.class, args); + } +} diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerClient.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerClient.java new file mode 100644 index 000000000..af0bb40b6 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerClient.java @@ -0,0 +1,81 @@ +/* + * 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. + */ +package org.onap.ccsdk.apps.cdssdclistener; + +import java.util.Optional; +import org.onap.ccsdk.apps.cdssdclistener.exceptions.CdsSdcListenerException; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.impl.DistributionClientFactory; +import org.onap.sdc.utils.DistributionActionResultEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.event.EventListener; +import org.springframework.stereotype.Component; + +@Component +public class CdsSdcListenerClient { + + private static Logger LOG = LoggerFactory.getLogger(CdsSdcListenerClient.class); + + @Autowired + private CdsSdcListenerConfiguration configuration; + + @Autowired + private CdsSdcListenerNotificationCallback notification; + + @Autowired + private CdsSdcListenerDto listenerDto; + + private IDistributionClient distributionClient; + + /** + * This method initializes the SDC Distribution client. + */ + @EventListener(ApplicationReadyEvent.class) + public void initSdcClient() throws CdsSdcListenerException { + LOG.info("Initialize the SDC distribution client"); + + distributionClient = Optional.of(DistributionClientFactory.createDistributionClient()) + .orElseThrow(() -> new CdsSdcListenerException("Could not able to create SDC Distribution client")); + + listenerDto.setDistributionClient(distributionClient); + + IDistributionClientResult result = distributionClient.init(configuration, notification); + + startSdcClientBasedOnTheResult(result); + } + + private void startSdcClientBasedOnTheResult(IDistributionClientResult result) throws CdsSdcListenerException { + if (!result.getDistributionActionResult().equals(DistributionActionResultEnum.SUCCESS)) { + throw new CdsSdcListenerException( + "SDC distribution client init failed with reason:" + result.getDistributionMessageResult()); + } + + // Start the client. + result = this.distributionClient.start(); + + if (!result.getDistributionActionResult().equals(DistributionActionResultEnum.SUCCESS)) { + throw new CdsSdcListenerException( + "Startup of the SDC distribution client failed with reason: " + result.getDistributionMessageResult()); + } + } + + private void closeSdcDistributionclient() throws CdsSdcListenerException { + + IDistributionClientResult status = this.distributionClient.stop(); + + LOG.info("Closing SDC distribution client"); + if (status.getDistributionActionResult().equals(DistributionActionResultEnum.SUCCESS)) { + throw new CdsSdcListenerException( + "Failed to close the SDC distribution client due to : " + status.getDistributionMessageResult()); + } + } +} diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerConfiguration.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerConfiguration.java new file mode 100644 index 000000000..0cbb917fc --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerConfiguration.java @@ -0,0 +1,137 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener; + +import java.util.List; +import org.onap.sdc.api.consumer.IConfiguration; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * In order to initiate a SDC distribution client we need to supply some pre-configuration values that + * distribution client needs. + */ +@ConfigurationProperties("listenerservice") +public class CdsSdcListenerConfiguration implements IConfiguration { + + public static final String TOSCA_CSAR = "TOSCA_CSAR"; + + @Value("${listenerservice.config.asdcAddress}") + private String asdcAddress; + + @Value("${listenerservice.config.messageBusAddress}") + private List<String> messageBusAddress; + + @Value("${listenerservice.config.user}") + private String user; + + @Value("${listenerservice.config.password}") + private String password; + + @Value("${listenerservice.config.pollingTimeout}") + private int pollingTimeout; + + @Value("${listenerservice.config.pollingInterval}") + private int pollingInterval; + + @Value("${listenerservice.config.relevantArtifactTypes}") + private List<String> relevantArtifactTypes; + + @Value("${listenerservice.config.consumerGroup}") + private String consumerGroup; + + @Value("${listenerservice.config.environmentName}") + private String envName; + + @Value("${listenerservice.config.consumerId}") + private String consumerId; + + @Value("${listenerservice.config.activateServerTLSAuth}") + private boolean activateServerTLSAuth; + + @Value("${listenerservice.config.isUseHttpsWithDmaap}") + private boolean isUseHttpsWithDmaap; + + + @Override + public String getAsdcAddress() { + return asdcAddress; + } + + @Override + public List<String> getMsgBusAddress() { + return messageBusAddress; + } + + @Override + public String getUser() { + return user; + } + + @Override + public String getPassword() { + return password; + } + + @Override + public int getPollingInterval() { + return pollingInterval; + } + + @Override + public int getPollingTimeout() { + return pollingTimeout; + } + + @Override + public List<String> getRelevantArtifactTypes() { + return relevantArtifactTypes; + } + + @Override + public String getConsumerGroup() { + return consumerGroup; + } + + @Override + public String getEnvironmentName() { + return envName; + } + + @Override + public String getConsumerID() { + return consumerId; + } + + @Override + public String getKeyStorePath() { + return null; + } + + @Override + public String getKeyStorePassword() { + return null; + } + + @Override + public boolean activateServerTLSAuth() { + return activateServerTLSAuth; + } + + @Override + public boolean isFilterInEmptyResources() { + return false; + } + + @Override + public Boolean isUseHttpsWithDmaap() { + return isUseHttpsWithDmaap; + } +} + diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerDto.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerDto.java new file mode 100644 index 000000000..afa753e5a --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerDto.java @@ -0,0 +1,23 @@ +/* + * 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. + */ +package org.onap.ccsdk.apps.cdssdclistener; + +import org.onap.sdc.api.IDistributionClient; + +public class CdsSdcListenerDto { + + private IDistributionClient distributionClient; + + public IDistributionClient getDistributionClient() { + return distributionClient; + } + + public void setDistributionClient(IDistributionClient distributionClient) { + this.distributionClient = distributionClient; + } +} diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerNotificationCallback.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerNotificationCallback.java new file mode 100644 index 000000000..35747635f --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerNotificationCallback.java @@ -0,0 +1,69 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener; + +import static org.onap.sdc.utils.DistributionActionResultEnum.SUCCESS; +import java.util.List; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.consumer.INotificationCallback; +import org.onap.sdc.api.notification.IArtifactInfo; +import org.onap.sdc.api.notification.INotificationData; +import org.onap.sdc.api.results.IDistributionClientDownloadResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class CdsSdcListenerNotificationCallback implements INotificationCallback { + + @Autowired + private CdsSdcListenerDto cdsSdcListenerDto; + + private static final Logger LOGGER = LoggerFactory.getLogger(CdsSdcListenerNotificationCallback.class); + + @Override + public void activateCallback(INotificationData notificationData) { + LOGGER.info(notificationData.getDistributionID(), "The UUID generated by SDC {}"); + processNotification(notificationData); + } + + private void processNotification(INotificationData notificationData) { + downlaodCsarArtifacts(notificationData.getServiceArtifacts()); + } + + /** + * Download the TOSCA CSAR artifact. + * @param artifactInfo - An object consists of Artifact information. + */ + private void downlaodCsarArtifacts(List<IArtifactInfo> artifactInfo) { + final IDistributionClient distributionClient = cdsSdcListenerDto.getDistributionClient(); + + artifactInfo.forEach(info -> { + final String url = info.getArtifactURL(); + final String id = info.getArtifactUUID(); + if (info.getArtifactType().equals(CdsSdcListenerConfiguration.TOSCA_CSAR)) { + LOGGER.info("Trying to download the artifact from : {} and UUID is {} ", url, id); + + IDistributionClientDownloadResult result = distributionClient.download(info); + + if (!result.getDistributionActionResult().equals(SUCCESS)) { + LOGGER.info("Failed to download the artifact from : {} due to {} ", url, + result.getDistributionActionResult()); + } else { + parseCBAFileFromCsar(result); + } + } + }); + } + + private void parseCBAFileFromCsar(IDistributionClientDownloadResult result) { + + } +} diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/exceptions/CdsSdcListenerException.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/exceptions/CdsSdcListenerException.java new file mode 100644 index 000000000..3f83b6ac2 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/exceptions/CdsSdcListenerException.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener.exceptions; + +public class CdsSdcListenerException extends Exception { + + /** + * @param message The message to dump + */ + public CdsSdcListenerException(final String message) { + super(message); + } + + /** + * @param message The message to dump + * @param cause The Throwable cause object + */ + public CdsSdcListenerException(final String message, final Throwable cause) { + super(message, cause); + } +} diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/service/ListenerService.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/service/ListenerService.java new file mode 100644 index 000000000..d6c2c4f40 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/service/ListenerService.java @@ -0,0 +1,18 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener.service; + +import java.io.File; + +public interface ListenerService { + + void extractBluePrint(File file); + + void storeBluePrint(File file); +} diff --git a/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/service/ListenerServiceImpl.java b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/service/ListenerServiceImpl.java new file mode 100644 index 000000000..864c485ce --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/java/org/onap/ccsdk/apps/cdssdclistener/service/ListenerServiceImpl.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener.service; + +import java.io.File; +import org.springframework.stereotype.Component; + +@Component +public class ListenerServiceImpl implements ListenerService { + + @Override + public void extractBluePrint(File file) { + //TODO + + } + + @Override + public void storeBluePrint(File file) { + //TODO + } +} diff --git a/ms/cds-sdc-listener/application/src/main/resources/application.yml b/ms/cds-sdc-listener/application/src/main/resources/application.yml new file mode 100644 index 000000000..1daef585b --- /dev/null +++ b/ms/cds-sdc-listener/application/src/main/resources/application.yml @@ -0,0 +1,17 @@ +listenerservice: + config: + asdcAddress: localhost:8443 + messageBusAddress: localhost + user: 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 + diff --git a/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerClientTest.java b/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerClientTest.java new file mode 100644 index 000000000..3a634b8c9 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerClientTest.java @@ -0,0 +1,71 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener; + +import mockit.Expectations; +import mockit.Injectable; +import mockit.Mock; +import mockit.MockUp; +import mockit.Tested; +import mockit.VerificationsInOrder; +import mockit.integration.junit4.JMockit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.ccsdk.apps.cdssdclistener.exceptions.CdsSdcListenerException; +import org.onap.sdc.api.IDistributionClient; +import org.onap.sdc.api.results.IDistributionClientResult; +import org.onap.sdc.impl.DistributionClientFactory; +import org.onap.sdc.impl.DistributionClientResultImpl; +import org.onap.sdc.utils.DistributionActionResultEnum; + +@RunWith(JMockit.class) +public class CdsSdcListenerClientTest { + + @Tested + private CdsSdcListenerClient cdsSdcListenerClient; + + @Test + public void testInitCdsClientSuccesfully(@Injectable IDistributionClient distributionClient, + @Injectable CdsSdcListenerConfiguration configuration, + @Injectable CdsSdcListenerNotificationCallback notification, + @Injectable CdsSdcListenerDto cdsSdcListenerDto) throws CdsSdcListenerException { + + // Arrange + new MockUp<DistributionClientFactory>() { + @Mock + public IDistributionClient createDistributionClient() { + return distributionClient; + } + }; + + new Expectations() {{ + distributionClient.init(configuration, notification); + result = getResult(); + }}; + + new Expectations() {{ + distributionClient.start(); + result = getResult(); + }}; + + // Act + cdsSdcListenerClient.initSdcClient(); + + // Verify + new VerificationsInOrder() {{ + distributionClient.init(configuration, notification); + distributionClient.start(); + }}; + } + + public IDistributionClientResult getResult() { + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, + DistributionActionResultEnum.SUCCESS.name()); + } +} diff --git a/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerConfigurationTest.java b/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerConfigurationTest.java new file mode 100644 index 000000000..886049df7 --- /dev/null +++ b/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerConfigurationTest.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + +package org.onap.ccsdk.apps.cdssdclistener; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@EnableConfigurationProperties(CdsSdcListenerConfiguration.class) +@SpringBootTest(classes = {CdsSdcListenerConfigurationTest.class}) +public class CdsSdcListenerConfigurationTest { + + @Autowired + private CdsSdcListenerConfiguration listenerConfiguration; + + @Test + public void testCdsSdcListenerConfiguration() { + assertEquals(listenerConfiguration.getAsdcAddress(), "localhost:8443"); + assertEquals(listenerConfiguration.getMsgBusAddress().stream().findFirst().get(), "localhost"); + assertEquals(listenerConfiguration.getUser(), "vid"); + assertEquals(listenerConfiguration.getPassword(), "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"); + assertEquals(listenerConfiguration.getPollingInterval(), 15); + assertEquals(listenerConfiguration.getPollingTimeout(), 15); + assertEquals(listenerConfiguration.getRelevantArtifactTypes().stream().findFirst().get(), "TOSCA_CSAR"); + assertEquals(listenerConfiguration.getConsumerGroup(), "cds-id-local"); + assertEquals(listenerConfiguration.getEnvironmentName(), "AUTO"); + assertEquals(listenerConfiguration.getConsumerID(), "cds-id-local"); + assertEquals(listenerConfiguration.activateServerTLSAuth(), false); + } +} diff --git a/ms/cds-sdc-listener/distribution/pom.xml b/ms/cds-sdc-listener/distribution/pom.xml new file mode 100644 index 000000000..60711f697 --- /dev/null +++ b/ms/cds-sdc-listener/distribution/pom.xml @@ -0,0 +1,106 @@ +<?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.apps</groupId> + <version>0.4.1-SNAPSHOT</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.onap.ccsdk.apps</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> diff --git a/ms/cds-sdc-listener/pom.xml b/ms/cds-sdc-listener/pom.xml new file mode 100644 index 000000000..538185ebc --- /dev/null +++ b/ms/cds-sdc-listener/pom.xml @@ -0,0 +1,29 @@ +<?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>ccsdk-apps-ms</artifactId> + <groupId>org.onap.ccsdk.apps</groupId> + <version>0.4.2-SNAPSHOT</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <artifactId>cds-sdc-listener</artifactId> + <name>CDS-SDC Listener Root</name> + <description>A microservice to get the cba file from SDC and store it into database at runtime</description> + <packaging>pom</packaging> + + <modules> + <module>application</module> + <!-- Module is not currently working + <module>distribution</module> + --> + </modules> + +</project> |