You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/05/10 20:59:57 UTC

[sling-whiteboard] 03/03: Adding a README, fixing the start logic and adding support for specifying the timeout duration

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

commit 585caf1a3afc733abb7308bf5477622df1000250
Author: Dan Klco <dk...@apache.org>
AuthorDate: Fri May 10 16:59:34 2019 -0400

    Adding a README, fixing the start logic and adding support for specifying the timeout duration
---
 release-validator/README.md | 33 +++++++++++++++++++++++++++++++++
 release-validator/run.sh    |  9 ++++-----
 2 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/release-validator/README.md b/release-validator/README.md
new file mode 100644
index 0000000..57d64d4
--- /dev/null
+++ b/release-validator/README.md
@@ -0,0 +1,33 @@
+# 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:
+
+ 1. Download / load the Sling Committer Public Keys
+ 1. Validate the code signatures for the release
+ 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
+
+To build the instance run:
+
+    docker build -t sling-check-release . 
+
+To run the docker container run:
+
+    docker run -e RELEASE_ID=[A_RELEASE_NUMBER] sling-check-release
+
+To keep the docker container up for 10 minutes to ensure the bundle is installed and working, execute:
+
+    docker run -e RELEASE_ID=[A_RELEASE_NUMBER] -e KEEP_RUNNING=true -P sling-check-release
+    
+## Environment Variables
+
+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
diff --git a/release-validator/run.sh b/release-validator/run.sh
index 32b29ec..ba51361 100644
--- a/release-validator/run.sh
+++ b/release-validator/run.sh
@@ -79,9 +79,9 @@ then
     RESP=$(curl -s http://localhost:8080/starter/index.html)
     if [[ "$RESP" == *"Do not remove this comment, used for Starter integration tests"* ]]; then
       echo "Sling Starter started!"
+      break
     else
       echo "Not yet started..."
-      break
     fi
   done
   
@@ -106,16 +106,15 @@ then
   echo "Release ${RELEASE_ID} verified successfully!"
   
   if [[ "$KEEP_RUNNING" == "true" ]]; then
-  	echo "Leaving Sling Starter running for 10 minutes for testing..."
+    TIMEOUT="${RUN_TIMEOUT:=10m}"
+  	echo "Leaving Sling Starter running for $TIMEOUT for testing..."
   	
   	printf "Run the following command to see the URL to connect to the Sling Starter under the PORT parameter:\n"
   	printf "\tdocker ps | grep sling-check-release"
 
-    sleep 10m
+    sleep $TIMEOUT
   fi
 else
-
   echo "Packaging is $MVN_PACKAGING, not bundle"
-  
   echo "Release ${RELEASE_ID} verified successfully!"
 fi
\ No newline at end of file