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:54 UTC

[sling-whiteboard] branch master updated (2499b10 -> 585caf1)

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

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


    from 2499b10  Add non bundles from features to the classpath as well
     new 2eaa177  Adding a docker configuration for validating and running builds
     new 6328ee5  Adding support for artifacts which already being with sling-
     new 585caf1  Adding a README, fixing the start logic and adding support for specifying the timeout duration

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 release-validator/Dockerfile |  11 ++++
 release-validator/README.md  |  33 ++++++++++++
 release-validator/init.sh    |  14 +++++
 release-validator/run.sh     | 120 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 178 insertions(+)
 create mode 100644 release-validator/Dockerfile
 create mode 100644 release-validator/README.md
 create mode 100644 release-validator/init.sh
 create mode 100644 release-validator/run.sh


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

Posted by dk...@apache.org.
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


[sling-whiteboard] 02/03: Adding support for artifacts which already being with sling-

Posted by dk...@apache.org.
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 6328ee52b00fed1d2bf7f6901fb132dfaee9da9b
Author: Dan Klco <dk...@apache.org>
AuthorDate: Fri May 10 16:04:32 2019 -0400

    Adding support for artifacts which already being with sling-
---
 release-validator/run.sh | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/release-validator/run.sh b/release-validator/run.sh
index 71bd8f5..32b29ec 100644
--- a/release-validator/run.sh
+++ b/release-validator/run.sh
@@ -7,10 +7,20 @@ curl https://people.apache.org/keys/group/sling.asc --output sling.asc || exit 1
 gpg --import sling.asc || exit 1
 
 echo "Validating release..."
-/bin/bash check_staged_release.sh ${RELEASE_VERSION} tmp || exit 1
+CHECK_RESULT=$(/bin/bash check_staged_release.sh ${RELEASE_ID} tmp)
+printf "\n$CHECK_RESULT\n"
+if [[ "$CHECK_RESULT" == *"BAD"* ]]; then
+  echo "Check(s) Failed!"
+  exit 1
+elif [[ "$CHECK_RESULT" = *"no files found"* ]]; then
+  echo "Staging repository ${RELEASE_ID} not found!"
+  exit 1
+else
+  echo "Check successful!"
+fi
 
 HAS_BUNDLE=false
-for RELEASE_FOLDER in tmp/${RELEASE_VERSION}/org/apache/sling/*
+for RELEASE_FOLDER in tmp/${RELEASE_ID}/org/apache/sling/*
 do
   echo "Running build for $RELEASE_FOLDER"
   
@@ -18,9 +28,14 @@ do
   MVN_PACKAGING=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.packaging}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
   MVN_VERSION=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.version}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
   MVN_ARTIFACT_ID=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.artifactId}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
-  REPO="sling-${MVN_ARTIFACT_ID//\./-}"
+  if [[ $MVN_ARTIFACT_ID == "sling-"* ]]; then
+    echo "Artifact ID starts with sling-, assuming it will not be duplicated..."
+    REPO="${MVN_ARTIFACT_ID//\./-}"
+  else
+    REPO="sling-${MVN_ARTIFACT_ID//\./-}"
+  fi
 
-  echo "Checking out code at ${MVN_VERSION}..."
+  echo "Checking out code from https://github.com/apache/$REPO.git..."
   git clone https://github.com/apache/$REPO.git || exit 1
   cd $REPO
   git checkout $MVN_ARTIFACT_ID-$MVN_VERSION || exit 1
@@ -62,8 +77,7 @@ then
   while true; do
     sleep 30
     RESP=$(curl -s http://localhost:8080/starter/index.html)
-    if [ "$RESP" == *"Do not remove this comment, used for Starter integration tests"* ]
-    then
+    if [[ "$RESP" == *"Do not remove this comment, used for Starter integration tests"* ]]; then
       echo "Sling Starter started!"
     else
       echo "Not yet started..."
@@ -72,11 +86,11 @@ then
   done
   
   echo "Installing bundles..."
-  for RELEASE_FOLDER in tmp/${RELEASE_VERSION}/org/apache/sling/*
+  for RELEASE_FOLDER in tmp/${RELEASE_ID}/org/apache/sling/*
   do
   
     MVN_PACKAGING=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.packaging}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
-    if [ "$MVN_PACKAGING" = "bundle" ] ; then
+    if [[ "$MVN_PACKAGING" = "bundle" ]] ; then
       echo "Installing bundle ${RELEASE_FOLDER}..."
     
       MVN_VERSION=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.version}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
@@ -89,10 +103,9 @@ then
     fi
   done
   
-  echo "Release ${RELEASE_VERSION} verified successfully!"
+  echo "Release ${RELEASE_ID} verified successfully!"
   
-  if [ "$KEEP_RUNNING" == "true" ]
-  then
+  if [[ "$KEEP_RUNNING" == "true" ]]; then
   	echo "Leaving Sling Starter running for 10 minutes for testing..."
   	
   	printf "Run the following command to see the URL to connect to the Sling Starter under the PORT parameter:\n"
@@ -104,5 +117,5 @@ else
 
   echo "Packaging is $MVN_PACKAGING, not bundle"
   
-  echo "Release ${RELEASE_VERSION} verified successfully!"
+  echo "Release ${RELEASE_ID} verified successfully!"
 fi
\ No newline at end of file


[sling-whiteboard] 01/03: Adding a docker configuration for validating and running builds

Posted by dk...@apache.org.
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 2eaa177d6e26a6069fda02d6cf005966f78298e2
Author: Dan Klco <dk...@apache.org>
AuthorDate: Fri May 10 15:33:58 2019 -0400

    Adding a docker configuration for validating and running builds
---
 release-validator/Dockerfile |  11 +++++
 release-validator/init.sh    |  14 ++++++
 release-validator/run.sh     | 108 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 133 insertions(+)

diff --git a/release-validator/Dockerfile b/release-validator/Dockerfile
new file mode 100644
index 0000000..62a655d
--- /dev/null
+++ b/release-validator/Dockerfile
@@ -0,0 +1,11 @@
+FROM store/oracle/serverjre:8
+
+WORKDIR /opt
+
+ADD init.sh .
+RUN /bin/bash init.sh
+
+EXPOSE 8080
+
+ADD run.sh .
+ENTRYPOINT /bin/bash run.sh
\ No newline at end of file
diff --git a/release-validator/init.sh b/release-validator/init.sh
new file mode 100644
index 0000000..239e9d9
--- /dev/null
+++ b/release-validator/init.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+echo "Installing dependencies..."
+yum install -y wget openssl git
+
+echo "Installing Apache Maven..."
+mkdir mvn
+curl ftp://ftp.osuosl.org/pub/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz --output mvn.tar.gz
+tar xzvf mvn.tar.gz --strip-components=1 -C mvn
+
+echo "Downloading check script..."
+curl 'https://gitbox.apache.org/repos/asf?p=sling-tooling-release.git;a=blob_plain;f=check_staged_release.sh;hb=HEAD' --output check_staged_release.sh
+
+echo "Initialization completed successfully!"
\ No newline at end of file
diff --git a/release-validator/run.sh b/release-validator/run.sh
new file mode 100644
index 0000000..71bd8f5
--- /dev/null
+++ b/release-validator/run.sh
@@ -0,0 +1,108 @@
+#!/bin/bash
+
+mkdir tmp
+
+echo "Loading PGP Keys..."
+curl https://people.apache.org/keys/group/sling.asc --output sling.asc || exit 1
+gpg --import sling.asc || exit 1
+
+echo "Validating release..."
+/bin/bash check_staged_release.sh ${RELEASE_VERSION} tmp || exit 1
+
+HAS_BUNDLE=false
+for RELEASE_FOLDER in tmp/${RELEASE_VERSION}/org/apache/sling/*
+do
+  echo "Running build for $RELEASE_FOLDER"
+  
+  echo "Resolving Maven Variables..."
+  MVN_PACKAGING=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.packaging}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
+  MVN_VERSION=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.version}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
+  MVN_ARTIFACT_ID=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.artifactId}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
+  REPO="sling-${MVN_ARTIFACT_ID//\./-}"
+
+  echo "Checking out code at ${MVN_VERSION}..."
+  git clone https://github.com/apache/$REPO.git || exit 1
+  cd $REPO
+  git checkout $MVN_ARTIFACT_ID-$MVN_VERSION || exit 1
+
+  echo "Building project..."
+  ../mvn/bin/mvn clean install || exit 1
+  
+  if [ "$MVN_PACKAGING" == "bundle" ]
+  then
+  	HAS_BUNDLE=true
+  fi
+
+  cd ..  
+done
+
+
+if [ "$HAS_BUNDLE" = true ];
+then
+  echo "Installing bundle..."
+  
+  mkdir run
+  
+  echo "Downloading Sling Starter..."
+  mvn/bin/mvn -q dependency:get -DremoteRepositories=https://repository.apache.org/content/groups/snapshots -DgroupId=org.apache.sling -DartifactId=org.apache.sling.starter -Dversion=LATEST -Dtransitive=false
+  mvn/bin/mvn -q dependency:copy -Dartifact=org.apache.sling:org.apache.sling.starter:LATEST -DoutputDirectory=run
+  
+  echo "Starting Sling Starter..."
+
+  mkdir -p sling/logs
+  (
+    (
+      java -server -Xmx1024m -XX:MaxPermSize=256M -Djava.awt.headless=true -jar run/*.jar  -p 8080 &
+    echo $! > app.pid
+    ) >> sling/logs/stdout.log 2>&1
+  ) &
+  
+  echo "Waiting for Sling to fully start..."
+
+  while true; do
+    sleep 30
+    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!"
+    else
+      echo "Not yet started..."
+      break
+    fi
+  done
+  
+  echo "Installing bundles..."
+  for RELEASE_FOLDER in tmp/${RELEASE_VERSION}/org/apache/sling/*
+  do
+  
+    MVN_PACKAGING=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.packaging}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
+    if [ "$MVN_PACKAGING" = "bundle" ] ; then
+      echo "Installing bundle ${RELEASE_FOLDER}..."
+    
+      MVN_VERSION=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.version}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
+      MVN_ARTIFACT_ID=$(mvn/bin/mvn -q -Dexec.executable=echo  -Dexec.args='${project.artifactId}' --non-recursive  exec:exec -f $RELEASE_FOLDER/**/*.pom)
+      REPO="sling-${MVN_ARTIFACT_ID//\./-}"
+  
+      curl -u admin:admin -F action=install -F bundlestartlevel=20 -F bundlefile=@"$REPO/target/$MVN_ARTIFACT_ID-$MVN_VERSION.jar" http://127.0.0.1:8080/system/console/bundles || exit 1
+    else
+      echo "Ignoring non-bundle ${RELEASE_FOLDER}..."
+    fi
+  done
+  
+  echo "Release ${RELEASE_VERSION} verified successfully!"
+  
+  if [ "$KEEP_RUNNING" == "true" ]
+  then
+  	echo "Leaving Sling Starter running for 10 minutes 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
+  fi
+else
+
+  echo "Packaging is $MVN_PACKAGING, not bundle"
+  
+  echo "Release ${RELEASE_VERSION} verified successfully!"
+fi
\ No newline at end of file