aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Paroulek <pavel.paroulek@orange.com>2019-05-13 20:23:31 +0200
committerPavel Paroulek <pavel.paroulek@orange.com>2019-05-14 10:17:34 +0200
commit48d76b552efaa7f3ac068519a0c06ab1ad65f2ea (patch)
tree45d7232f78b63fc704803426de265ffc56381dab
parent1722ddc1b782c79d881a11eb06df66c6e2ab6029 (diff)
Maven based building
Building the project (docker, user interface) via maven Change-Id: I94ef02b435f0684cedbafb63b5daeb44abfe22cc Issue-ID: AAI-531 Signed-off-by: Pavel Paroulek <pavel.paroulek@orange.com>
-rw-r--r--README.md15
-rw-r--r--pom.xml117
-rw-r--r--src/main/resources/application.properties18
-rw-r--r--src/main/resources/docker-assembly.xml23
-rw-r--r--src/main/resources/etc/auth/aai_keystorebin0 -> 4928 bytes
-rw-r--r--src/main/resources/etc/auth/realm.properties13
6 files changed, 164 insertions, 22 deletions
diff --git a/README.md b/README.md
index 167f40f..9cfa65c 100644
--- a/README.md
+++ b/README.md
@@ -16,18 +16,7 @@ Then go to http://localhost:3000
In order to start the webservices run the App.java from your Java IDE (the service runs on localhost port 8080).
-## Running from command line
+## Building docker images
-To run GraphGraph from the command line just run the shell script:
-### `./run.sh`
-
-## Creating a standalone jar
-
-To create a standalone Java jar file run the build script:
-
-### `./buildjar.sh`
-
-Afterwards you can start GraphGraph just by running the command:
-
-### `java -jar ./target/graphgraph-1.0-SNAPSHOT.jar`
+### `mvn clean install -Pdocker
diff --git a/pom.xml b/pom.xml
index eb7e378..10a4669 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
<properties>
<nexusproxy>https://nexus.onap.org</nexusproxy>
- <site.path>/content/sites/site/org/onap/aai/resources/${project.artifactId}/${project.version}</site.path>
+ <site.path>/content/sites/site/org/onap/aai/graphgraph/${project.artifactId}/${project.version}</site.path>
<release.path>/content/repositories/releases/</release.path>
<snapshot.path>/content/repositories/snapshots/</snapshot.path>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -18,6 +18,13 @@
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<spring.boot.version>1.5.19.RELEASE</spring.boot.version>
+
+ <docker.fabric.version>0.23.0</docker.fabric.version>
+ <docker.registry>docker.io</docker.registry>
+ <docker.push.registry>localhost:5000</docker.push.registry>
+ <aai.docker.namespace>onap</aai.docker.namespace>
+ <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/</aai.build.directory>
+ <graphgraph.startpath>src/main/resources/</graphgraph.startpath>
</properties>
<dependencyManagement>
@@ -78,15 +85,116 @@
</dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>docker</id>
+ <properties>
+ <graphgraph.startpath>/graphgraph/</graphgraph.startpath>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>fabric8-maven-plugin</artifactId>
+ <version>4.1.0</version>
+ <configuration>
+ <verbose>true</verbose>
+ <images>
+ <image>
+ <name>graphgraph:${project.version}</name>
+ <build>
+ <from>aaionap/aai-common:1.3.0</from>
+ <entryPoint>
+ <exec>
+ <arg>java</arg>
+ <arg>-jar</arg>
+ <arg>/graphgraph/${project.artifactId}-${project.version}.${project.packaging}</arg>
+ </exec>
+ </entryPoint>
+ <assembly>
+ <targetDir>/graphgraph</targetDir>
+ <descriptor>${project.basedir}/src/main/resources/docker-assembly.xml</descriptor>
+ </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>push</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
<build>
- <pluginManagement>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
<plugins>
- <plugin>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <version>1.7.6</version>
+ <executions>
+ <execution>
+ <id>install node</id>
+ <goals>
+ <goal>install-node-and-npm</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <workingDirectory>${project.basedir}/graphgraph-fe</workingDirectory>
+ <nodeVersion>v10.10.0</nodeVersion>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm install</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <workingDirectory>${project.basedir}/graphgraph-fe</workingDirectory>
+ <arguments>install</arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm build</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <workingDirectory>${project.basedir}/graphgraph-fe</workingDirectory>
+ <arguments>run build</arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
- <id>copy-resources</id>
+ <id>copy-resources-ui</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
@@ -116,7 +224,6 @@
</executions>
</plugin>
</plugins>
- </pluginManagement>
</build>
<distributionManagement>
<repository>
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 07d5a00..c152118 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -7,7 +7,7 @@ schema.source.name=onap
schema.nodes.location=${server.local.startpath}/schema/${schema.source.name}/oxm/
schema.edges.location=${server.local.startpath}/schema/${schema.source.name}/dbedgerules/
-server.local.startpath=src/main/resources/
+server.local.startpath=${graphgraph.startpath}
schema.ingest.file=${server.local.startpath}/application.properties
# Schema Version Related Attributes
@@ -29,10 +29,20 @@ schema.version.edge.label.start=v12
# Specifies the version that the application should default to
schema.version.api.default=v16
schema.translator.list=schema-service
-schema.service.base.url=http://localhost:8452/aai/schema-service/v1/
-schema.service.client=no-auth
+schema.service.base.url=https://localhost:8452/aai/schema-service/v1/
+# schema.service.client=no-auth
schema.service.nodes.endpoint=nodes?version=
schema.service.edges.endpoint=edgerules?version=
schema.service.versions.endpoint=versions
-schema.service.versions.override=false \ No newline at end of file
+schema.service.versions.override=false
+
+schema.service.ssl.enabled-protocols=TLSv1.1,TLSv1.2
+schema.service.ssl.key-store=${server.local.startpath}etc/auth/aai_keystore
+schema.service.ssl.key-store-password=changeit
+schema.service.ssl.trust-store=${server.local.startpath}etc/auth/aai_keystore
+schema.service.ssl.trust-store-password=changeit
+schema.service.ssl.client-auth=want
+schema.service.ssl.key-store-type=JKS
+
+schema.service.client=one-way-ssl \ No newline at end of file
diff --git a/src/main/resources/docker-assembly.xml b/src/main/resources/docker-assembly.xml
new file mode 100644
index 0000000..afd1970
--- /dev/null
+++ b/src/main/resources/docker-assembly.xml
@@ -0,0 +1,23 @@
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+ <id>distribution</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>src/main/resources/etc/auth</directory>
+ <outputDirectory>/etc/auth</outputDirectory>
+ <filtered>false</filtered>
+ </fileSet>
+ </fileSets>
+
+<files>
+ <file>
+ <source>target/${project.artifactId}-${project.version}.${project.packaging}</source>
+ <outputDirectory>/</outputDirectory>
+ <filtered>false</filtered>
+ </file>
+</files>
+</assembly> \ No newline at end of file
diff --git a/src/main/resources/etc/auth/aai_keystore b/src/main/resources/etc/auth/aai_keystore
new file mode 100644
index 0000000..16d93a7
--- /dev/null
+++ b/src/main/resources/etc/auth/aai_keystore
Binary files differ
diff --git a/src/main/resources/etc/auth/realm.properties b/src/main/resources/etc/auth/realm.properties
new file mode 100644
index 0000000..f0e0172
--- /dev/null
+++ b/src/main/resources/etc/auth/realm.properties
@@ -0,0 +1,13 @@
+# format : username: password[,rolename ...]
+# default username/password: AAI/AAI, MSO/MSO, ModelLoader/ModelLoader...
+AAI:OBF:1gfr1ev31gg7,admin
+MSO:OBF:1jzx1lz31k01,admin
+SDNC:OBF:1itr1i0l1i151isv,admin
+DCAE:OBF:1g8u1f9d1f991g8w,admin
+POLICY:OBF:1mk61i171ima1im41i0j1mko,admin
+ASDC:OBF:1f991j0u1j001f9d,admin
+VID:OBF:1jm91i0v1jl9,admin
+APPC:OBF:1f991ksf1ksf1f9d,admin
+ModelLoader:OBF:1qvu1v2h1sov1sar1wfw1j7j1wg21saj1sov1v1x1qxw,admin
+AaiUI:OBF:1gfr1p571unz1p4j1gg7,admin
+OOF:OBF:1img1ke71ily,admin