aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Puzikov <dmitry.puzikov@tieto.com>2019-09-25 14:19:36 +0200
committerDmitry Puzikov <dmitry.puzikov@tieto.com>2019-10-15 10:42:36 +0200
commited4a579fcddbb3028f7668923fa83d756bdf2f8f (patch)
treed3fb7da40d23e4fe8ad037d8809b1e9b2ce98e50
parent8b763cd0c644dec143482e40ab54710d983cacfa (diff)
Mavenized image creation for readiness-check
Issue-ID: INT-1045 Change-Id: I9c7b7fd26c8f376600aa7efc9c1d9e2eee001cde Signed-off-by: Dmitry Puzikov <dmitry.puzikov@tieto.com>
-rw-r--r--kubernetes/readiness/.gitignore15
-rw-r--r--kubernetes/readiness/pom.xml109
-rw-r--r--kubernetes/readiness/src/main/docker/Dockerfile (renamed from kubernetes/readiness/docker/init/Dockerfile)9
-rw-r--r--kubernetes/readiness/src/main/scripts/job_complete.py (renamed from kubernetes/readiness/docker/init/job_complete.py)0
-rw-r--r--kubernetes/readiness/src/main/scripts/ready.py (renamed from kubernetes/readiness/docker/init/ready.py)0
5 files changed, 127 insertions, 6 deletions
diff --git a/kubernetes/readiness/.gitignore b/kubernetes/readiness/.gitignore
new file mode 100644
index 0000000000..90cb66eacd
--- /dev/null
+++ b/kubernetes/readiness/.gitignore
@@ -0,0 +1,15 @@
+# Eclipse
+.classpath
+.factorypath
+.project
+.pydevproject
+.settings/
+
+# IntelliJ
+.idea/*
+*.iml
+
+# Mac OS
+*DS_Store*
+
+/target \ No newline at end of file
diff --git a/kubernetes/readiness/pom.xml b/kubernetes/readiness/pom.xml
new file mode 100644
index 0000000000..af834ff4c2
--- /dev/null
+++ b/kubernetes/readiness/pom.xml
@@ -0,0 +1,109 @@
+<!--
+
+ ============LICENSE_START=======================================================
+ org.onap.aai
+ ================================================================================
+ Copyright © 2017-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=========================================================
+
+-->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>2.0.0</version>
+ </parent>
+
+ <groupId>org.onap.oom.readiness.check</groupId>
+ <artifactId>readiness-check-docker</artifactId>
+ <version>2.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>oom-readiness-check-image</name>
+ <description>Contains dockerfiles and scrtipts for readiness-ckeck image.</description>
+
+ <properties>
+ <docker.fabric.version>0.31.0</docker.fabric.version>
+ <oom.docker.namespace>onap</oom.docker.namespace>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>${docker.fabric.version}</version>
+ <configuration>
+ <verbose>true</verbose>
+ <apiVersion>1.23</apiVersion>
+ <images>
+ <image>
+ <name>${docker.push.registry}/${oom.docker.namespace}/readiness-check:%l</name>
+ <build>
+ <filter>@</filter>
+ <assembly>
+ <mode>dir</mode>
+ <inline xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <fileSets>
+ <fileSet>
+ <directory>${project.basedir}/src/main/scripts</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </inline>
+ </assembly>
+ <tags>
+ <tag>latest</tag>
+ <tag>latest-${project.version}</tag>
+ </tags>
+ <cleanup>try</cleanup>
+ <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
+ </build>
+ </image>
+ </images>
+ </configuration>
+ <executions>
+ <execution>
+ <id>clean-images</id>
+ <phase>pre-clean</phase>
+ <goals>
+ <goal>remove</goal>
+ </goals>
+ <configuration>
+ <removeAll>true</removeAll>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-images</id>
+ <phase>package</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>
+</project> \ No newline at end of file
diff --git a/kubernetes/readiness/docker/init/Dockerfile b/kubernetes/readiness/src/main/docker/Dockerfile
index b060915354..638e8efd67 100644
--- a/kubernetes/readiness/docker/init/Dockerfile
+++ b/kubernetes/readiness/src/main/docker/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:2-alpine
+FROM python:3-alpine3.9
ENV no_proxy "localhost,127.0.0.1,.cluster.local,$KUBERNETES_SERVICE_HOST"
# Setup Corporate proxy
@@ -10,11 +10,8 @@ RUN pip install requests pyyaml kubernetes
ENV CERT="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
ENV TOKEN="/var/run/secrets/kubernetes.io/serviceaccount/token"
-COPY ready.py /root/ready.py
-RUN chmod a+x /root/ready.py
-
-COPY job_complete.py /root/job_complete.py
-RUN chmod a+x /root/job_complete.py
+COPY maven/ /root/
+RUN chmod -R a+x /root/
ENTRYPOINT ["/root/ready.py"]
CMD [""] \ No newline at end of file
diff --git a/kubernetes/readiness/docker/init/job_complete.py b/kubernetes/readiness/src/main/scripts/job_complete.py
index a9570c5951..a9570c5951 100644
--- a/kubernetes/readiness/docker/init/job_complete.py
+++ b/kubernetes/readiness/src/main/scripts/job_complete.py
diff --git a/kubernetes/readiness/docker/init/ready.py b/kubernetes/readiness/src/main/scripts/ready.py
index 3f76d10395..3f76d10395 100644
--- a/kubernetes/readiness/docker/init/ready.py
+++ b/kubernetes/readiness/src/main/scripts/ready.py