diff options
Diffstat (limited to 'cmso-database')
-rw-r--r-- | cmso-database/docker/Dockerfile | 11 | ||||
-rw-r--r-- | cmso-database/etc/config/liquibase.properties | 14 | ||||
-rw-r--r-- | cmso-database/pom.xml | 65 | ||||
-rw-r--r-- | cmso-database/src/main/docker/Dockerfile | 29 | ||||
-rw-r--r-- | cmso-database/src/main/docker/assembly/cmso-files.xml | 58 | ||||
-rw-r--r-- | cmso-database/src/main/docker/extra-files/startService.sh | 4 |
6 files changed, 154 insertions, 27 deletions
diff --git a/cmso-database/docker/Dockerfile b/cmso-database/docker/Dockerfile deleted file mode 100644 index 40251ec..0000000 --- a/cmso-database/docker/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM anapsix/alpine-java:8_jdk - -ENV DBUPGRADE_HOME=/opt/app/dbupgrade - -VOLUME /volume/config -VOLUME /volume/logs - -ADD target/docker-liquibase.jar ${DBUPGRADE_HOME}/lib/docker-liquibase.jar -ADD bin ${DBUPGRADE_HOME}/bin - -ENTRYPOINT ["/bin/bash", "-x", "/opt/app/dbupgrade/bin/docker_start.sh"]
\ No newline at end of file diff --git a/cmso-database/etc/config/liquibase.properties b/cmso-database/etc/config/liquibase.properties index 82c2f42..2454070 100644 --- a/cmso-database/etc/config/liquibase.properties +++ b/cmso-database/etc/config/liquibase.properties @@ -28,16 +28,10 @@ # See the License for the specific language governing permissions and
# limitations under the License.
###
-
-#spring.datasource.url=jdbc:mysql://localhost:3306/cmso?createDatabaseIfNotExist=true
-#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
-#spring.datasource.username=root
-#spring.datasource.password=root
-#
-#spring.datasource.url=jdbc:mariadb://localhost:3306/calendar?createDatabaseIfNotExist=true
-#spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
-#spring.datasource.username=root
-#spring.datasource.password=root
+spring.datasource.jdbcUrl=jdbc:mariadb://localhost:3306/cmso?createDatabaseIfNotExist=true
+spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
+spring.datasource.username=root
+spring.datasource.password=beer
spring.datasource.initialize=false
spring.datasource.tomcat.max-wait=10000
diff --git a/cmso-database/pom.xml b/cmso-database/pom.xml index bef54fd..7a7146e 100644 --- a/cmso-database/pom.xml +++ b/cmso-database/pom.xml @@ -38,7 +38,7 @@ <artifactId>oparent</artifactId>
<version>1.2.0</version>
</parent>
-
+
<groupId>org.onap.optf.cmso</groupId>
<artifactId>liquibase</artifactId>
<version>0.1.0-SNAPSHOT</version>
@@ -92,10 +92,6 @@ <artifactId>liquibase-core</artifactId>
</dependency>
<dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- </dependency>
- <dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
@@ -106,7 +102,17 @@ <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
- <version>2.0.4.RELEASE</version>
+ <version>${spring.boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ <configuration>
+ <mainClass>${start-class}</mainClass>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
@@ -116,6 +122,53 @@ <propertyFile>etc/config/liquibase.properties</propertyFile>
</configuration>
</plugin>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.26.0</version>
+ <configuration>
+ <verbose>true</verbose>
+ <apiVersion>1.23</apiVersion>
+ <images>
+ <image>
+ <name>onap/cmso-dbinit</name>
+ <alias>onap-cmso-dbinit</alias>
+ <build>
+ <cleanup>true</cleanup>
+ <tags>
+ <tag>latest</tag>
+ </tags>
+ <dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile>
+ <assembly>
+ <descriptor>${project.basedir}/src/main/docker/assembly/cmso-files.xml</descriptor>
+ <name>onap-cmso</name>
+ </assembly>
+ </build>
+ </image>
+ </images>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-images</id>
+ <phase>install</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>push-images</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>build</goal>
+ <goal>push</goal>
+ </goals>
+ <configuration>
+ <image>onap/cmso-init:%l</image>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
<finalName>docker-liquibase</finalName>
</build>
diff --git a/cmso-database/src/main/docker/Dockerfile b/cmso-database/src/main/docker/Dockerfile new file mode 100644 index 0000000..8837ee7 --- /dev/null +++ b/cmso-database/src/main/docker/Dockerfile @@ -0,0 +1,29 @@ +FROM ubuntu:16.04 + +MAINTAINER "The Onap Team" +LABEL Description="This image contains ubuntu 16.04 with the openjdk installed" Version="16.04-8" +ENV APP_HOME=/opt/app/cmso-dbinit +ARG http_proxy +ARG https_proxy +ENV HTTP_PROXY=$http_proxy +ENV HTTPS_PROXY=$https_proxy +ENV http_proxy=$HTTP_PROXY +ENV https_proxy=$HTTPS_PROXY + +RUN test -n "$http_proxy" && echo "Acquire::Proxy \"http://$http_proxy\";" > /etc/apt/apt.conf.d/02proxy || true && \ + apt-get update && \ + apt-get -y dist-upgrade && \ + apt-get install -y openjdk-8-jre-headless + +COPY onap-cmso/docker-liquibase.jar ${APP_HOME}/app.jar +COPY onap-cmso/startService.sh ${APP_HOME}/startService.sh + +RUN chmod 700 ${APP_HOME}/startService.sh +RUN ln -s /share/etc ${APP_HOME}/etc +RUN ln -s /share/logs ${APP_HOME}/logs + +VOLUME /share/etc +VOLUME /share/logs + +WORKDIR ${APP_HOME} +ENTRYPOINT ./startService.sh diff --git a/cmso-database/src/main/docker/assembly/cmso-files.xml b/cmso-database/src/main/docker/assembly/cmso-files.xml new file mode 100644 index 0000000..bdcb699 --- /dev/null +++ b/cmso-database/src/main/docker/assembly/cmso-files.xml @@ -0,0 +1,58 @@ +<!-- + ============LICENSE_START======================================================= + ECOMP CMSO + ================================================================================ + Copyright (C) 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========================================================= + --> + +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd"> + <id>cmso-files</id> + + <formats> + <format>tar.gz</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + + + <fileSets> + <!-- include config files --> + <fileSet> + <includes> + <include>${project.build.finalName}.jar</include> + </includes> + <directory>${project.build.directory}</directory> + <outputDirectory>/</outputDirectory> + </fileSet> + <fileSet> + <includes> + <include>etc/keystore/**</include> + </includes> + <directory>${project.build.directory}</directory> + <outputDirectory>/</outputDirectory> + </fileSet> + <fileSet> + <includes> + <include>**</include> + </includes> + <directory>src/main/docker/extra-files</directory> + <outputDirectory>/</outputDirectory> + </fileSet> + </fileSets> + +</assembly> diff --git a/cmso-database/src/main/docker/extra-files/startService.sh b/cmso-database/src/main/docker/extra-files/startService.sh new file mode 100644 index 0000000..bc46c71 --- /dev/null +++ b/cmso-database/src/main/docker/extra-files/startService.sh @@ -0,0 +1,4 @@ +#!/bin/sh +echo "VM_ARGS="${VM_ARGS} + +java -Djava.security.egd=file:/dev/./urandom ${VM_ARGS} -Xms256m -Xmx1024m -jar ./app.jar --spring.config.location=/share/etc/config/liquibase.properties |