Merge "Mavenized image creation for readiness-check"
authorBorislav Glozman <Borislav.Glozman@amdocs.com>
Wed, 11 Dec 2019 14:28:33 +0000 (14:28 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 11 Dec 2019 14:28:33 +0000 (14:28 +0000)
kubernetes/readiness/.gitignore [new file with mode: 0644]
kubernetes/readiness/pom.xml [new file with mode: 0644]
kubernetes/readiness/src/main/docker/Dockerfile [moved from kubernetes/readiness/docker/init/Dockerfile with 68% similarity]
kubernetes/readiness/src/main/scripts/job_complete.py [moved from kubernetes/readiness/docker/init/job_complete.py with 100% similarity]
kubernetes/readiness/src/main/scripts/ready.py [moved from kubernetes/readiness/docker/init/ready.py with 100% similarity]

diff --git a/kubernetes/readiness/.gitignore b/kubernetes/readiness/.gitignore
new file mode 100644 (file)
index 0000000..90cb66e
--- /dev/null
@@ -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 (file)
index 0000000..af834ff
--- /dev/null
@@ -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
@@ -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