diff options
-rw-r--r-- | Dockerfile | 52 | ||||
-rw-r--r-- | misc/dmaapbc | 2 | ||||
-rw-r--r-- | pom.xml | 375 | ||||
-rw-r--r-- | src/main/resources/docker-compose.yml | 25 | ||||
-rw-r--r-- | src/main/resources/docker-databus-controller.conf | 12 | ||||
-rw-r--r-- | version.properties | 2 |
6 files changed, 241 insertions, 227 deletions
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b246871..0000000 --- a/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -# -# ============LICENSE_START========================================== -# org.onap.dmaap -# =================================================================== -# Copyright © 2018 AT&T Intellectual Property. All rights reserved. -# =================================================================== -# Licensed 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. -# ============LICENSE_END============================================ -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -# -# -FROM java:openjdk-8-jre -MAINTAINER Dominic Lunanuova -ENV insdir /opt/app/dmaapbc -RUN \ - mkdir -p ${insdir}/lib \ - && mkdir -p ${insdir}/etc \ - && mkdir -p ${insdir}/logs \ - && mkdir -p ${insdir}/www && mkdir -p ${insdir}/www/doc \ - && mkdir -p ${insdir}/config \ - && mkdir -p ${insdir}/misc \ - && mkdir -p ${insdir}/bin -WORKDIR ${insdir} -USER root -COPY target/buscontroller.jar ${insdir}/lib/ -COPY misc/LocalKey ${insdir}/etc/ -COPY misc/logback.xml ${insdir}/etc/ -COPY misc/dbc-api.jks ${insdir}/etc/keystore -RUN chmod 600 ${insdir}/etc/keystore -COPY misc/org.onap.dmaap-bc.trust.jks ${insdir}/etc -RUN chmod 600 ${insdir}/etc/org.onap.dmaap-bc.trust.jks -COPY ./version.properties ${insdir}/etc -COPY misc/opensource.env ${insdir}/misc/ -COPY misc/*.tmpl ${insdir}/misc/ -COPY misc/cert-client-init.sh ${insdir}/misc/ -RUN chmod +x ${insdir}/misc/cert-client-init.sh -COPY misc/dmaapbc ${insdir}/bin/ -RUN chmod +x ${insdir}/bin/* -COPY misc/doaction ${insdir}/bin/ - -VOLUME ${insdir}/log -CMD ["./bin/dmaapbc", "deploy" ] diff --git a/misc/dmaapbc b/misc/dmaapbc index 0ade56b..cef472e 100644 --- a/misc/dmaapbc +++ b/misc/dmaapbc @@ -168,7 +168,7 @@ init() { while [ $rc != "200" ] do sleep 10 - rc=`curl -s -w "%{http_code}" -X GET -H "Content-Type: application/json" http://dmaap-bc:8080/webapi/dmaap` + rc=`curl -s -o /dev/null -I -w "%{http_code}" -X GET -H "Content-Type: application/json" http://dmaap-bc:8080/webapi/dmaap` echo "get dmaap response=${rc}" done @@ -19,7 +19,8 @@ ============LICENSE_END============================================ ECOMP is a trademark and service mark of AT&T Intellectual Property. --> -<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/maven-v4_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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.onap.dmaap.buscontroller</groupId> <artifactId>buscontroller</artifactId> @@ -31,7 +32,7 @@ <version>1.2.0</version> <relativePath/> </parent> - <build> + <build> <finalName>buscontroller</finalName> <plugins> @@ -50,13 +51,12 @@ <message>No Snapshots Allowed!</message> <excludes> <exclude>org.onap.dmaap.dbcapi:dbcapi</exclude> - <exclude>org.onap.aaf.authz:aaf-cadi-client</exclude> - <exclude>org.onap.aaf.authz:aaf-misc-env</exclude> - <exclude>org.onap.aaf.authz:aaf-cadi-aaf</exclude> - <exclude>org.onap.aaf.authz:aaf-auth-client</exclude> - <exclude>org.onap.aaf.authz:aaf-cadi-core</exclude> - <exclude>org.onap.aaf.authz:aaf-misc-rosetta</exclude> - + <exclude>org.onap.aaf.authz:aaf-cadi-client</exclude> + <exclude>org.onap.aaf.authz:aaf-misc-env</exclude> + <exclude>org.onap.aaf.authz:aaf-cadi-aaf</exclude> + <exclude>org.onap.aaf.authz:aaf-auth-client</exclude> + <exclude>org.onap.aaf.authz:aaf-cadi-core</exclude> + <exclude>org.onap.aaf.authz:aaf-misc-rosetta</exclude> </excludes> </requireReleaseDeps> </rules> @@ -66,76 +66,73 @@ </executions> </plugin> - <!-- Package an Uber jar --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>2.4.3</version> - <executions> - <!-- Run shade goal on package phase --> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <!-- this filter section is needed to avoid runtime error: - java.lang.SecurityException: Invalid signature file digest for Manifest main attributes - suggestion found at: https://stackoverflow.com/q/999489 - --> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <exclude>META-INF/*.SF</exclude> - <exclude>META-INF/*.DSA</exclude> - <exclude>META-INF/*.RSA</exclude> - </excludes> - </filter> - </filters> - <transformers> - <!-- NOTE: Need the following transformer else gets "Could not resolve type id 'https' into a subtype" error - Solution found from here: - http://stackoverflow.com/questions/27543060/why-does-dropwizard-configuration-is-not-working - Some more context here: - https://github.com/dropwizard/dropwizard/issues/455 --> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> - <!-- add Main-Class to manifest file --> - <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> - <mainClass>org.onap.dmaap.dbcapi.server.Main</mainClass> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - - - + <!-- Package an Uber jar --> <plugin> - <groupId>org.sonatype.plugins</groupId> - <artifactId>nexus-staging-maven-plugin</artifactId> - <extensions>true</extensions> - <configuration> - <serverId>ecomp-staging</serverId> - <nexusUrl>${nexusproxy}</nexusUrl> - <stagingProfileId>176c31dfe190a</stagingProfileId> - </configuration> - </plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>2.4.3</version> + <executions> + <!-- Run shade goal on package phase --> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <!-- this filter section is needed to avoid runtime error: + java.lang.SecurityException: Invalid signature file digest for Manifest main attributes + suggestion found at: https://stackoverflow.com/q/999489 + --> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + </excludes> + </filter> + </filters> + <transformers> + <!-- NOTE: Need the following transformer else gets "Could not resolve type id 'https' into a subtype" error + Solution found from here: + http://stackoverflow.com/questions/27543060/why-does-dropwizard-configuration-is-not-working + Some more context here: + https://github.com/dropwizard/dropwizard/issues/455 --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + <!-- add Main-Class to manifest file --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>org.onap.dmaap.dbcapi.server.Main</mainClass> + </transformer> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.sonatype.plugins</groupId> + <artifactId>nexus-staging-maven-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <serverId>ecomp-staging</serverId> + <nexusUrl>${nexusproxy}</nexusUrl> + <stagingProfileId>176c31dfe190a</stagingProfileId> + </configuration> + </plugin> - <!-- for Distribution management --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <dependencies> - <dependency> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-webdav-jackrabbit</artifactId> - <version>2.10</version> - </dependency> - </dependencies> - </plugin> + <!-- for Distribution management --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-webdav-jackrabbit</artifactId> + <version>2.10</version> + </dependency> + </dependencies> + </plugin> </plugins> <pluginManagement> @@ -153,10 +150,10 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <versionRange>[2.10,)</versionRange> - <phase>install</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> + <phase>install</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> </pluginExecutionFilter> <action> <ignore/> @@ -169,49 +166,81 @@ </plugins> </pluginManagement> </build> - <profiles> - <profile> - <id>docker</id> - <build> - <plugins> - <plugin> - <groupId>com.spotify</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>1.0.0</version> - <configuration> - <imageName>${onap.nexus.dockerregistry.daily}/${docker.image}</imageName> - <dockerDirectory>${project.basedir}</dockerDirectory> - <serverId>${onap.nexus.dockerregistry.daily}</serverId> - <imageTags> - <imageTag>${artifact.version}</imageTag> - <imageTag>latest</imageTag> - </imageTags> - <forceTags>true</forceTags> - <resources> - <resource> - <targetPath>/</targetPath> - <directory>${project.basedir}</directory> - <excludes> - <exclude>target/**/*</exclude> - <exclude>pom.xml</exclude> - </excludes> - </resource> - - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>**/**</include> - </resource> - </resources> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>1.0.0</version> + <configuration> + <baseImage>java:openjdk-8-jre</baseImage> + <imageName>${onap.nexus.dockerregistry.daily}/${docker.image}</imageName> + <entryPoint>["./bin/dmaapbc", "deploy"]</entryPoint> + <serverId>${onap.nexus.dockerregistry.daily}</serverId> + <imageTags> + <imageTag>${artifact.version}</imageTag> + <imageTag>latest</imageTag> + </imageTags> + <volumes> + <volume>/opt/app/dmaapbc/log</volume> + </volumes> + <forceTags>true</forceTags> + <user>root</user> + <resources> + <resource> + <targetPath>/opt/app/dmaapbc/lib</targetPath> + <directory>target</directory> + <include>buscontroller.jar</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/etc</targetPath> + <directory>misc</directory> + <include>LocalKey</include> + <include>logback.xml</include> + <include>org.onap.dmaap-bc.trust.jks</include> + <include>dbc-api.jks</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/etc</targetPath> + <directory>.</directory> + <include>version.properties</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/misc</targetPath> + <directory>misc</directory> + <include>opensource.env</include> + <include>cert-client-init.sh</include> + <include>*.tmpl</include> + </resource> + <resource> + <targetPath>/opt/app/dmaapbc/bin</targetPath> + <directory>misc</directory> + <include>dmaapbc</include> + <include>doaction</include> + </resource> + </resources> + <runs> + <run>mv /opt/app/dmaapbc/etc/dbc-api.jks /opt/app/dmaapbc/etc/keystore</run> + <run>chmod 600 /opt/app/dmaapbc/etc/keystore</run> + <run>chmod 600 /opt/app/dmaapbc/etc/org.onap.dmaap-bc.trust.jks</run> + <run>chmod +x /opt/app/dmaapbc/misc/cert-client-init.sh</run> + <run>chmod +x /opt/app/dmaapbc/bin/*</run> + <run>mkdir /opt/app/dmaapbc/logs</run> + <run>mkdir /opt/app/dmaapbc/www</run> + <run>mkdir /opt/app/dmaapbc/www/doc</run> + </runs> + <workdir>/opt/app/dmaapbc</workdir> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> <dependencyManagement> <dependencies> - <dependency> <groupId>org.glassfish.jersey</groupId> <artifactId>jersey-bom</artifactId> @@ -222,21 +251,21 @@ </dependencies> </dependencyManagement> <dependencies> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-core</artifactId> - <version>1.5.13</version> - </dependency> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-jersey2-jaxrs</artifactId> - <version>1.5.13</version> - </dependency> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-annotations</artifactId> - <version>1.5.13</version> - </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-core</artifactId> + <version>1.5.13</version> + </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-jersey2-jaxrs</artifactId> + <version>1.5.13</version> + </dependency> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-annotations</artifactId> + <version>1.5.13</version> + </dependency> <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet-core</artifactId> @@ -257,12 +286,12 @@ <artifactId>jetty-server</artifactId> <version>${jettyVersion}</version> </dependency> - <dependency> - <groupId>org.onap.aaf.authz</groupId> - <artifactId>aaf-cadi-aaf</artifactId> - <version>2.1.2-SNAPSHOT</version> - <classifier>full</classifier> - </dependency> + <dependency> + <groupId>org.onap.aaf.authz</groupId> + <artifactId>aaf-cadi-aaf</artifactId> + <version>2.1.2-SNAPSHOT</version> + <classifier>full</classifier> + </dependency> <dependency> <groupId>org.eclipse.jetty</groupId> @@ -293,16 +322,16 @@ <artifactId>postgresql</artifactId> <version>9.4.1208.jre7</version> </dependency> - <dependency> - <groupId>com.att.eelf</groupId> - <artifactId>eelf-core</artifactId> - <version>${eelf.version}</version> - </dependency> - <dependency> - <groupId>org.onap.dmaap.dbcapi</groupId> - <artifactId>dbcapi</artifactId> - <version>1.0.15-SNAPSHOT</version> - </dependency> + <dependency> + <groupId>com.att.eelf</groupId> + <artifactId>eelf-core</artifactId> + <version>${eelf.version}</version> + </dependency> + <dependency> + <groupId>org.onap.dmaap.dbcapi</groupId> + <artifactId>dbcapi</artifactId> + <version>1.0.15-SNAPSHOT</version> + </dependency> </dependencies> <reporting> <plugins> @@ -326,35 +355,35 @@ </reporting> <distributionManagement> - <site> - <id>ecomp-site</id> - <url>dav:${nexusproxy}${sitePath}</url> - </site> + <site> + <id>ecomp-site</id> + <url>dav:${nexusproxy}${sitePath}</url> + </site> </distributionManagement> <properties> <jersey.version>2.16</jersey.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <jettyVersion>9.3.8.RC0</jettyVersion> <eelf.version>0.0.1</eelf.version> - <artifact.version>1.0.19</artifact.version> - <!-- SONAR --> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Default Sonar configuration --> - <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath> - <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + <artifact.version>1.0.20</artifact.version> + <!-- SONAR --> + <jacoco.version>0.7.7.201606060606</jacoco.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath> + <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> - <!-- docker image --> - <docker.image>onap/dmaap/buscontroller</docker.image> + <!-- docker image --> + <docker.image>onap/dmaap/buscontroller</docker.image> - <nexusproxy>https://nexus.onap.org</nexusproxy> - <docker.push.registry>nexus3.onap.org:10003</docker.push.registry> + <nexusproxy>https://nexus.onap.org</nexusproxy> + <docker.push.registry>nexus3.onap.org:10003</docker.push.registry> - <!-- for Distribution Management --> - <sitePath>/content/sites/site/org/onap/dmaap/buscontroller/${artifact.version}</sitePath> + <!-- for Distribution Management --> + <sitePath>/content/sites/site/org/onap/dmaap/buscontroller/${artifact.version}</sitePath> </properties> - <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container. </description> + <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container.</description> </project> diff --git a/src/main/resources/docker-compose.yml b/src/main/resources/docker-compose.yml new file mode 100644 index 0000000..41bc473 --- /dev/null +++ b/src/main/resources/docker-compose.yml @@ -0,0 +1,25 @@ +version: '2' +services: + dbc-pg-primary: + image: crunchydata/crunchy-postgres:centos7-10.4-2.0.0 + ports: + - "5432:5432" + environment: + - PG_MODE=master + - PG_PRIMARY_USER="dmaap_admin" + - PG_PRIMARY_PASSWORD=onapdemodb + - PG_USER="dmaap_admin" + - PG_PASSWORD=onapdemodb + - PG_ROOT_PASSWORD=onapdemodb + - PG_DATABASE="dmaap" + - PG_PRIMARY_PORT=5432 + + dmaap-bc: + image: nexus3.onap.org:10001/onap/dmaap/buscontroller:latest + ports: + - "30241:8080" + - "30242:8443" + volumes: + - /var/tmp/docker-databus-controller.conf:/opt/app/config/conf + depends_on: + - dbc-pg-primary diff --git a/src/main/resources/docker-databus-controller.conf b/src/main/resources/docker-databus-controller.conf new file mode 100644 index 0000000..7214adf --- /dev/null +++ b/src/main/resources/docker-databus-controller.conf @@ -0,0 +1,12 @@ +DMAAPBC_WAIT_TO_EXIT=Y +DMAAPBC_PG_ENABLED=true +DMAAPBC_PGHOST=dbc-pg-primary +DMAAPBC_PGDBNAME=dmaap +DMAAPBC_PGCRED=onapdemodb +DMAAPBC_PGUSER=dmaap_admin +DMAAPBC_MR_CNAME=message-router +DMAAPBC_AAF_URL=https://aaf-authz/ +DMAAPBC_TOPICMGR_USER=m23456@dmaapbc.onap.org +DMAAPBC_TOPICMGR_PWD=onapdemo +DMAAPBC_ADMIN_USER=m12345@dmaapbc.onap.org +DMAAPBC_ADMIN_PWD=onapdemo
\ No newline at end of file diff --git a/version.properties b/version.properties index 4a63197..b51743c 100644 --- a/version.properties +++ b/version.properties @@ -27,7 +27,7 @@ major=1 minor=0 -patch=19 +patch=20 base_version=${major}.${minor}.${patch} # Release must be completed with git revision # in Jenkins |