Return-Path: X-Original-To: apmail-tinkerpop-commits-archive@minotaur.apache.org Delivered-To: apmail-tinkerpop-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB1B618B57 for ; Fri, 9 Oct 2015 15:50:31 +0000 (UTC) Received: (qmail 40905 invoked by uid 500); 9 Oct 2015 15:50:31 -0000 Delivered-To: apmail-tinkerpop-commits-archive@tinkerpop.apache.org Received: (qmail 40879 invoked by uid 500); 9 Oct 2015 15:50:31 -0000 Mailing-List: contact commits-help@tinkerpop.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.incubator.apache.org Delivered-To: mailing list commits@tinkerpop.incubator.apache.org Received: (qmail 40869 invoked by uid 99); 9 Oct 2015 15:50:31 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2015 15:50:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 51AE4C17C2 for ; Fri, 9 Oct 2015 15:50:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id oqUCfMLTH4L7 for ; Fri, 9 Oct 2015 15:50:19 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 0D3E8439E1 for ; Fri, 9 Oct 2015 15:50:18 +0000 (UTC) Received: (qmail 39783 invoked by uid 99); 9 Oct 2015 15:50:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2015 15:50:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D765E03AD; Fri, 9 Oct 2015 15:50:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: okram@apache.org To: commits@tinkerpop.incubator.apache.org Date: Fri, 09 Oct 2015 15:50:21 -0000 Message-Id: In-Reply-To: <6adf78398f8b445fb53db51e4c02b1f0@git.apache.org> References: <6adf78398f8b445fb53db51e4c02b1f0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/30] incubator-tinkerpop git commit: added shell script to verify binary releases added shell script to verify binary releases Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/845fd59c Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/845fd59c Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/845fd59c Branch: refs/heads/TINKERPOP3-876 Commit: 845fd59caab053c2d19663a85dd65e25c37a0d44 Parents: 3f94580 Author: Daniel Kuppitz Authored: Thu Oct 8 20:21:11 2015 +0200 Committer: Daniel Kuppitz Committed: Thu Oct 8 20:21:11 2015 +0200 ---------------------------------------------------------------------- bin/validate-distribution.sh | 103 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/845fd59c/bin/validate-distribution.sh ---------------------------------------------------------------------- diff --git a/bin/validate-distribution.sh b/bin/validate-distribution.sh new file mode 100755 index 0000000..2f624d2 --- /dev/null +++ b/bin/validate-distribution.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +TMP_DIR="/tmp/tpdv" + +VERSION=${1} +URL=${2} +TYPE=${3} + +if [ -z ${VERSION} ]; then + echo -e "\nUsage:\n\t${0} {VERSION}\n" + exit 1 +fi + +if [ -z ${URL} ]; then + + CONSOLE_URL="https://www.apache.org/dist/incubator/tinkerpop/${VERSION}/apache-gremlin-console-${VERSION}-bin.zip" + SERVER_URL="https://www.apache.org/dist/incubator/tinkerpop/${VERSION}/apache-gremlin-server-${VERSION}-bin.zip" + + echo -e "\nValidating binary distribution\n" + + ${0} ${VERSION} ${CONSOLE_URL} "CONSOLE" && ${0} ${VERSION} ${SERVER_URL} "SERVER" + + EXIT_CODE=$? + + [[ ${EXIT_CODE} -eq 0 ]] && rm -rf ${TMP_DIR} + + echo && exit ${EXIT_CODE} +fi + +mkdir -p ${TMP_DIR} +rm -rf ${TMP_DIR}/* +cd ${TMP_DIR} + +# validate downloads +ZIP_FILENAME=`grep -o '[^/]*$' <<< ${URL}` +DIR_NAME=`sed 's/-[^-]*$//' <<< ${ZIP_FILENAME}` +COMPONENT=`tr '-' $'\n' <<< ${ZIP_FILENAME} | head -n3 | while read word ; do echo "${word^}" ; done | paste -sd ' '` + +echo -n "* downloading ${COMPONENT} ... " +wget -q ${URL} ${URL}.asc ${URL}.md5 ${URL}.sha1 || (echo "Failed to download ${COMPONENT}" ; exit 1) +echo "OK" + +# validate zip file +echo -n "* validating checksums ... " +[ `gpg ${ZIP_FILENAME}.asc 2>&1 | grep -c '^gpg: Good signature from "Stephen Mallette "$'` -eq 1 ] || \ +[ `gpg ${ZIP_FILENAME}.asc 2>&1 | grep -c '^gpg: Good signature from "Marko Rodriguez "$'` -eq 1 ] || \ +{ echo "${COMPONENT}'s PGP checksum verification failed"; exit 1; } +EXPECTED=`cat ${ZIP_FILENAME}.md5` +ACTUAL=`md5sum ${ZIP_FILENAME} | awk '{print $1}'` +[ "$ACTUAL" = "${EXPECTED}" ] || { echo "${COMPONENT}'s MD5 checksum verification failed"; exit 1; } +EXPECTED=`cat ${ZIP_FILENAME}.sha1` +ACTUAL=`sha1sum ${ZIP_FILENAME} | awk '{print $1}'` +[ "$ACTUAL" = "${EXPECTED}" ] || { echo "${COMPONENT}'s SHA1 checksum verification failed"; exit 1; } +echo "OK" + +echo -n "* unzipping ${COMPONENT} ... " +unzip -q ${ZIP_FILENAME} || { echo "Failed to unzip ${COMPONENT}"; exit 1; } +[ -d ${DIR_NAME} ] || { echo "${COMPONENT} was not extracted into the expected directory"; exit 1; } +echo "OK" + +# validate docs/ and javadocs/ directories +echo -n "* validating ${COMPONENT}'s docs ... " +cd ${DIR_NAME} +[ -d "docs" ] && [ -f "docs/index.html" ] && [ -d "docs/images" ] || { echo "docs/ directory is incomplete or not present"; exit 1; } +[ -d "javadocs/core" ] && [ -d "javadocs/full" ] || { echo "javadocs/ directory is incomplete or not present"; exit 1; } +x=`find javadocs -name 'GraphTraversal.html' | wc -l` +[[ ${x} -eq 4 ]] || { echo "${COMPONENT}'s javadocs/ directory is incomplete"; exit 1; } +echo "OK" + +echo -n "* validating ${COMPONENT}'s binaries ... " +[ -d "bin" ] || { echo "bin/ directory is not present"; exit 1; } + +GREMLIN_SHELL_SCRIPT=`find bin/ -name "gremlin*.sh"` +GREMLIN_BATCH_SCRIPT=`find bin/ -name "gremlin*.bat"` + +[ ! -z ${GREMLIN_SHELL_SCRIPT} ] && [ -s ${GREMLIN_SHELL_SCRIPT} ] || { echo "Gremlin shell script is not present or empty"; exit 1; } +[ ! -z ${GREMLIN_BATCH_SCRIPT} ] && [ -s ${GREMLIN_BATCH_SCRIPT} ] || { echo "Gremlin batch script is not present or empty"; exit 1; } +echo "OK" + +echo -n "* validating ${COMPONENT}'s legal files ... " +for file in "LICENSE" "NOTICE" "DISCLAIMER" +do + [ -f ${file} ] || { echo "${file} is not present"; exit 1; } + [ -s ${file} ] || { echo "${file} is empty"; exit 1; } +done +echo "OK" + +echo -n "* validating ${COMPONENT}'s plugin directory ... " +[ -d "ext" ] || { echo "ext/ directory is not present"; exit 1; } +if [ "${TYPE}" = "CONSOLE" ] || [[ `tr -d '.' <<< ${VERSION} | sed 's/-.*//'` -gt 301 ]]; then + [ -d "ext/gremlin-groovy" ] && [ -d "ext/tinkergraph-gremlin" ] && [ -s "ext/plugins.txt" ] || { echo "ext/ directory is not present or incomplete"; exit 1; } +fi +echo "OK" + +echo -n "* validating ${COMPONENT}'s lib directory ... " +[ -d "lib" ] && [[ `du lib | cut -f1 | wc -c` -ge 6 ]] || { echo "lib/ directory is not present or incomplete"; exit 1; } +echo "OK" + +if [ "${TYPE}" = "CONSOLE" ]; then + echo -n "* testing script evaluation ... " + [[ `bin/gremlin.sh <<< 'TinkerFactory.createModern().traversal().V().count()' | grep '^==>' | sed 's/^==>//'` -eq 6 ]] || { echo "failed to evaluate sample script"; exit 1; } + echo "OK" +fi