From: Thanh Ha Date: Mon, 13 Jun 2016 04:05:35 +0000 (-0400) Subject: Add macro to deploy archives to Nexus X-Git-Tag: v0.0.6~26 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=8f023d66f597ac9a8afdfb61ffeff886a9d08eef;p=releng%2Flftools.git Add macro to deploy archives to Nexus Requires the Description Setter plugin: https://wiki.jenkins-ci.org/display/JENKINS/Description+Setter+Plugin Change-Id: Ibc3d4a74416995b699e420864626dabd8a3c0658 Signed-off-by: Thanh Ha --- diff --git a/include-raw-deploy-archives.sh b/include-raw-deploy-archives.sh new file mode 100644 index 00000000..8fe112c2 --- /dev/null +++ b/include-raw-deploy-archives.sh @@ -0,0 +1,70 @@ +#!/bin/bash +ARCHIVES_DIR="$JOB_NAME/`date +'%Y-%m-%d.%H%M%S'`-$BUILD_NUMBER-$BUILD_CAUSE" +LOGS_SERVER="https://logs.opendaylight.org" +echo "Build logs: $LOGS_SERVER/$SILO/$ARCHIVES_DIR" + +mkdir .archives +cd .archives/ + +cat > deploy-archives.xml < + 4.0.0 + logs + logs + 1.0.0 + pom + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + maven-upload-plugin + 0.0.1 + + + publish-site + deploy + + upload-file + + + opendaylight-log-archives + https://nexus.opendaylight.org/service/local/repositories/logs/content-compressed + archives.zip + $SILO + + + + + + + +EOF + +mkdir -p $ARCHIVES_DIR +mv $WORKSPACE/archives/ $ARCHIVES_DIR +touch $ARCHIVES_DIR/_build-details.txt +echo "build-url: ${{BUILD_URL}}" >> $ARCHIVES_DIR/_build-details.txt +wget -O $ARCHIVES_DIR/_console-output.log ${{BUILD_URL}}consoleText +gzip $ARCHIVES_DIR/*.txt $ARCHIVES_DIR/*.log +# find and gzip all text files +find $ARCHIVES_DIR -name "*.txt" \ + -o -name "*.log" \ + -o -name "*.html" \ + | xargs gzip + +zip -r archives.zip $JOB_NAME/ + +# Notify Gerrit where logs are located +if [ -n "$GERRIT_PATCHSET_REVISION" ]; then + LOG_MESSAGE="Logs located at https://nexus.opendaylight.org/content/sites/logs/$SILO/$ARCHIVES_DIR/" + ssh -p 29418 git.opendaylight.org gerrit review -m "$LOG_MESSAGE" $GERRIT_PATCHSET_REVISION +fi