This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch branch-feature-jenkins-test
in repository https://gitbox.apache.org/repos/asf/ambari-infra.git


The following commit(s) were added to refs/heads/branch-feature-jenkins-test by 
this push:
     new 8c9848f  add Makefile + docker build changes for infra-solr
8c9848f is described below

commit 8c9848f2c6d199b1661ccf1a19c9a96798943239
Author: Oliver Szabo <[email protected]>
AuthorDate: Mon Oct 1 23:06:43 2018 +0200

    add Makefile + docker build changes for infra-solr
---
 Makefile                                           | 32 ++++++++++++++++++++++
 ambari-infra-assembly/pom.xml                      | 15 ++++++++--
 ambari-infra-manager-it/pom.xml                    |  4 +--
 jenkins/build.sh                                   | 32 ----------------------
 .../{infra-solr => docker-infra-solr}/Dockerfile   | 22 ++++++++++-----
 .../bin/entrypoint.sh                              |  0
 .../{infra-solr => docker-infra-solr}/bin/init.sh  |  0
 .../conf/infra-solr.conf                           |  0
 .../conf/solr.xml                                  |  0
 9 files changed, 62 insertions(+), 43 deletions(-)

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8620dbe
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+# 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.
+
+GIT_REV_SHORT = $(shell git rev-parse --short HEAD)
+MAVEN_BINARY ?= mvn
+
+package:
+       $(MAVEN_BINARY) clean package
+
+test:
+       $(MAVEN_BINARY) clean test
+
+rpm:
+       $(MAVEN_BINARY) clean package -Dbuild-rpm -DskipTests
+
+deb:
+       $(MAVEN_BINARY) clean package -Dbuild-deb -DskipTests
+
+docker-build:
+       $(MAVEN_BINARY) clean package docker:build -DskipTests -Dbuild-deb
+
+docker-push:
+       $(MAVEN_BINARY) clean package docker:build docker:push -DskipTests 
-Dbuild-deb
diff --git a/ambari-infra-assembly/pom.xml b/ambari-infra-assembly/pom.xml
index 9cd0b7e..fe9d72e 100644
--- a/ambari-infra-assembly/pom.xml
+++ b/ambari-infra-assembly/pom.xml
@@ -45,6 +45,7 @@
     
<common-fileupload.location.url>http://central.maven.org/maven2/commons-fileupload/commons-fileupload/1.3.3/commons-fileupload-1.3.3.jar</common-fileupload.location.url>
     
<common-fileupload.jar.name>commons-fileupload-1.3.3.jar</common-fileupload.jar.name>
     
<common-fileupload.old.jar.name>commons-fileupload-1.3.2.jar</common-fileupload.old.jar.name>
+    <jenkins.docker.folder>../jenkins/containers</jenkins.docker.folder>
   </properties>
 
   <profiles>
@@ -397,6 +398,16 @@
                           
toDir="${project.build.directory}/solr/server/solr-webapp/webapp/WEB-INF/lib/"/>
                     <chmod file="${project.build.directory}/solr/bin/**" 
perm="755"/>
                     <chmod 
file="${project.build.directory}/solr/server/scripts/**" perm="755"/>
+
+                    <copy todir="${project.build.directory}" >
+                      <fileset dir="${jenkins.docker.folder}" includes="**"/>
+                    </copy>
+                    <copy 
todir="${project.build.directory}/docker-infra-solr/solr" >
+                      <fileset dir="${project.build.directory}/solr" 
includes="**"/>
+                    </copy>
+                    <copy 
todir="${project.build.directory}/docker-infra-solr/solr-client" >
+                      <fileset dir="${solr.client.dir}/target/package" 
includes="**"/>
+                    </copy>
                   </target>
                 </configuration>
               </execution>
@@ -405,13 +416,13 @@
           <plugin>
             <groupId>io.fabric8</groupId>
             <artifactId>docker-maven-plugin</artifactId>
-            <version>0.27.1</version>
             <configuration>
+              <verbose>true</verbose>
               <images>
                 <image>
                   <name>apache/ambari-infra-solr:latest</name>
                   <build>
-                    <from>openjdk:10-jdk</from>
+                    
<dockerFileDir>${project.build.directory}/docker-infra-solr</dockerFileDir>
                   </build>
                 </image>
               </images>
diff --git a/ambari-infra-manager-it/pom.xml b/ambari-infra-manager-it/pom.xml
index c9b8bad..2fac6a9 100644
--- a/ambari-infra-manager-it/pom.xml
+++ b/ambari-infra-manager-it/pom.xml
@@ -34,7 +34,7 @@
   <properties>
     <jbehave.version>4.0.5</jbehave.version>
     <failsafe-plugin.version>2.20</failsafe-plugin.version>
-    <docker.host>localhost</docker.host>
+    <infra-manager.docker.host>localhost</infra-manager.docker.host>
     <stories.location>NONE</stories.location>
   </properties>
 
@@ -202,7 +202,7 @@
                   </includes>
                   <systemPropertyVariables>
                     
<log4j.configuration>file:${project.build.testOutputDirectory}/log4j.properties</log4j.configuration>
-                    <docker.host>${docker.host}</docker.host>
+                    <docker.host>${infra-manager.docker.host}</docker.host>
                     
<backend.stories.location>${stories.location}</backend.stories.location>
                   </systemPropertyVariables>
                 </configuration>
diff --git a/jenkins/build.sh b/jenkins/build.sh
deleted file mode 100755
index 669ff7d..0000000
--- a/jenkins/build.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env bash
-#   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.
-
-readlinkf(){
-  # get real path on mac OSX
-  perl -MCwd -e 'print Cwd::abs_path shift' "$1";
-}
-
-if [ "$(uname -s)" = 'Linux' ]; then
-  SCRIPT_DIR="`dirname "$(readlink -f "$0")"`"
-else
-  SCRIPT_DIR="`dirname "$(readlinkf "$0")"`"
-fi
-
-INFRA_PROJECT_DIR="`dirname \"$SCRIPT_DIR\"`"
-
-cd $INFRA_PROJECT_DIR
-
-mvn clean package -DskipTests -Drat.skip=true -Dbuild-deb
-
-docker build -t apache/ambari-infra-solr:latest -f 
jenkins/containers/infra-solr/Dockerfile .
-docker push apache/ambari-infra-solr:latest
diff --git a/jenkins/containers/infra-solr/Dockerfile 
b/jenkins/containers/docker-infra-solr/Dockerfile
similarity index 70%
rename from jenkins/containers/infra-solr/Dockerfile
rename to jenkins/containers/docker-infra-solr/Dockerfile
index 973be7e..18a1290 100644
--- a/jenkins/containers/infra-solr/Dockerfile
+++ b/jenkins/containers/docker-infra-solr/Dockerfile
@@ -13,13 +13,13 @@ FROM openjdk:10-jre
 MAINTAINER [email protected]
 
 RUN apt-get update && apt-get install -y python
-ADD jenkins/containers/infra-solr/bin /infra-solr/bin
-ADD jenkins/containers/infra-solr/conf /infra-solr/conf
-ADD ambari-infra-assembly/target/ambari-infra-solr_2.0.0.0-SNAPSHOT.deb 
/infra-solr/ambari-infra-solr.deb
-ADD ambari-infra-assembly/target/ambari-infra-solr-client_2.0.0.0-SNAPSHOT.deb 
/infra-solr/ambari-infra-solr-client.deb
-RUN dpkg -i /infra-solr/ambari-infra-solr.deb
-RUN dpkg -i /infra-solr/ambari-infra-solr-client.deb
-RUN mkdir -p /var/lib/ambari-infra-solr/data
+
+ADD bin /infra-solr/bin
+ADD conf /infra-solr/conf
+ADD solr /usr/lib/ambari-infra-solr
+ADD solr-client /usr/lib/ambari-infra-solr-client
+
+RUN mkdir -p /var/lib/ambari-infra-solr/data && mkdir -p 
/etc/ambari-infra-solr/conf
 
 ENV SOLR_USER="infra-solr"
 ENV SOLR_GROUP="infra-solr"
@@ -35,9 +35,17 @@ RUN cp /infra-solr/conf/infra-solr.conf 
/etc/security/limits.d/
 
 RUN groupadd -r --gid $SOLR_GID $SOLR_GROUP && useradd -r --uid $SOLR_UID 
--gid $SOLR_GID $SOLR_USER
 RUN chown -R $SOLR_USER:$SOLR_GROUP /usr/lib/ambari-infra-solr
+RUN chown -R $SOLR_USER:$SOLR_GROUP /etc/ambari-infra-solr/conf
 RUN chown -R $SOLR_USER:$SOLR_GROUP /var/lib/ambari-infra-solr/data
 RUN chown -R $SOLR_USER:$SOLR_GROUP /usr/lib/ambari-infra-solr-client
 RUN chown -R $SOLR_USER:$SOLR_GROUP /infra-solr && chmod +x 
/infra-solr/bin/entrypoint.sh
+RUN find /usr/lib/ambari-infra-solr -type d -exec chmod 755 {} +
+RUN find /usr/lib/ambari-infra-solr -type f -exec chmod 644 {} +
+RUN find /usr/lib/ambari-infra-solr-client -type d -exec chmod 755 {} +
+RUN find /usr/lib/ambari-infra-solr-client -type f -exec chmod 644 {} +
+
+RUN ls -la /usr/lib/ambari-infra-solr
+
 USER $SOLR_USER
 
 WORKDIR /infra-solr/bin/
diff --git a/jenkins/containers/infra-solr/bin/entrypoint.sh 
b/jenkins/containers/docker-infra-solr/bin/entrypoint.sh
similarity index 100%
rename from jenkins/containers/infra-solr/bin/entrypoint.sh
rename to jenkins/containers/docker-infra-solr/bin/entrypoint.sh
diff --git a/jenkins/containers/infra-solr/bin/init.sh 
b/jenkins/containers/docker-infra-solr/bin/init.sh
similarity index 100%
rename from jenkins/containers/infra-solr/bin/init.sh
rename to jenkins/containers/docker-infra-solr/bin/init.sh
diff --git a/jenkins/containers/infra-solr/conf/infra-solr.conf 
b/jenkins/containers/docker-infra-solr/conf/infra-solr.conf
similarity index 100%
rename from jenkins/containers/infra-solr/conf/infra-solr.conf
rename to jenkins/containers/docker-infra-solr/conf/infra-solr.conf
diff --git a/jenkins/containers/infra-solr/conf/solr.xml 
b/jenkins/containers/docker-infra-solr/conf/solr.xml
similarity index 100%
rename from jenkins/containers/infra-solr/conf/solr.xml
rename to jenkins/containers/docker-infra-solr/conf/solr.xml

Reply via email to