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

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 0318cf6  Updating to use a base CentOS7 image and installing the JDK 
so we can have the JDK instead of Oracle's Server JRE which doesn't have javadoc
0318cf6 is described below

commit 0318cf66890fca4e98ceea293ceb6fe3656f77be
Author: Dan Klco <[email protected]>
AuthorDate: Mon May 13 14:14:45 2019 -0400

    Updating to use a base CentOS7 image and installing the JDK so we can have 
the JDK instead of Oracle's Server JRE which doesn't have javadoc
---
 release-validator/Dockerfile |  3 ++-
 release-validator/README.md  | 14 +++++++++-----
 release-validator/init.sh    | 12 +++++++++++-
 release-validator/run.sh     |  4 ++--
 4 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/release-validator/Dockerfile b/release-validator/Dockerfile
index 62a655d..cce307d 100644
--- a/release-validator/Dockerfile
+++ b/release-validator/Dockerfile
@@ -1,8 +1,9 @@
-FROM store/oracle/serverjre:8
+FROM centos
 
 WORKDIR /opt
 
 ADD init.sh .
+ADD *.rpm .
 RUN /bin/bash init.sh
 
 EXPOSE 8080
diff --git a/release-validator/README.md b/release-validator/README.md
index 57d64d4..ca2311a 100644
--- a/release-validator/README.md
+++ b/release-validator/README.md
@@ -1,7 +1,6 @@
 # Release Validator
 
 A docker container for validating Apache Sling releases using the release ID. 
-This project assumes you already have docker installed and configured on your 
local system.
 
 This container will:
 
@@ -10,11 +9,16 @@ This container will:
  1. Build each progress in the release
  1. If any project in the release is in a bundle, start an Apache Sling 
Starter and install as a bundle
 
-## Commands
+## Setup
+
+This project assumes you have already 
[installed](https://docs.docker.com/install/) on your local system.
 
-To build the instance run:
+To build the container instance, you must first download the desired JDK. 
Download the RPM Linux 64 installer
+into the project root directory, then run:
 
-    docker build -t sling-check-release . 
+    docker build -t sling-check-release .
+
+## Commands
 
 To run the docker container run:
 
@@ -30,4 +34,4 @@ The following environment variables are supported:
 
  - **KEEP_RUNNING** - If set to true, the Sling instace will be left running, 
default is false
  - **RELEASE_ID** - The ID of the release to validate, required
- - **RUN_TIMEOUT** - The amount of time for the Sling instance to be left 
running, default is 10m
\ No newline at end of file
+ - **RUN_TIMEOUT** - The amount of time for the Sling instance to be left 
running, default is 10m
diff --git a/release-validator/init.sh b/release-validator/init.sh
index b3c88a8..ad1b376 100644
--- a/release-validator/init.sh
+++ b/release-validator/init.sh
@@ -1,7 +1,17 @@
 #!/bin/bash
 
 echo "Installing dependencies..."
-yum install -y wget openssl git jq
+yum install epel-release -y
+yum install -y wget openssl git jq which
+
+echo "Installing Java..."
+yum localinstall -y *.rpm
+
+echo "Configuring JAVA_HOME..."
+JAVA_VERSION=$(ls /usr/java/ | grep jdk)
+echo export JAVA_HOME="/usr/java/$JAVA_VERSION" >/etc/profile.d/javaenv.sh
+echo 'export PATH=$PATH:$JAVA_HOME' >> /etc/profile.d/javaenv.sh
+chmod 0755 /etc/profile.d/javaenv.sh
 
 echo "Installing Apache Maven..."
 mkdir mvn
diff --git a/release-validator/run.sh b/release-validator/run.sh
index 4e13907..4b98596 100644
--- a/release-validator/run.sh
+++ b/release-validator/run.sh
@@ -158,7 +158,7 @@ then
       while [ $ATTEMPT -lt 12 ]; do
         sleep 10
         BUNDLE_RESPONSE=$(curl -s -u admin:admin 
http://127.0.0.1:8080/system/console/bundles/$MVN_ARTIFACT_ID.json)
-        let STATE=$(echo $BUNDLE_RESPONSE | jq -r '.data[0].state')
+        STATE=$(echo $BUNDLE_RESPONSE | jq -r '.data[0].state')
         IMPORTS_IN_ERROR=$(echo $BUNDLE_RESPONSE | jq -r '.data[0].props[] | 
select(.key == "Imported Packages").value[] | select( contains("ERROR") )')
         if [[ "$STATE" == "Active" ]]; then
           prints "Bundle $MVN_ARTIFACT_ID started successfully!" "success"
@@ -192,7 +192,7 @@ then
     CONTAINER_ID=$(cat /etc/hostname)
        
        echo "Run the following command to see the URL to connect to the Sling 
Starter:"
-       printf "\tdocker port $CONTAINER_ID\n"
+       printf "\tdocker port $CONTAINER_ID 8080\n"
        echo "If you are satisfied, the container can be stopped with:"
        printf "\tdocker stop $CONTAINER_ID\n"
 

Reply via email to