From: Thanh Ha Date: Thu, 29 Jun 2017 22:42:16 +0000 (-0400) Subject: Use lftools nexus-zip command to deploy Maven site X-Git-Tag: release/nitrogen~315^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=00870f7c7defd9b2e470e97027105d19948e8979;p=releng%2Fbuilder.git Use lftools nexus-zip command to deploy Maven site Rather than uploading 1 small file at a time using cURL to upload a Nexus site allows us to push a single binary blob to the site url. This massively speeds up site deploys. Issue: RELENG-210 Change-Id: I365739ce13cfe805fe3ec51ad10c5b974647c9a0 Signed-off-by: Thanh Ha --- diff --git a/jjb/opendaylight-infra-deploy-maven-site.sh b/jjb/opendaylight-infra-deploy-maven-site.sh new file mode 100644 index 000000000..6664532ce --- /dev/null +++ b/jjb/opendaylight-infra-deploy-maven-site.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# @License EPL-1.0 +############################################################################## +# Copyright (c) 2017 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## + +# Ensure we fail the job if any steps fail. +set -eu -o pipefail + +MAVEN_GROUP_ID=$(xmlstarlet sel \ + -N "x=http://maven.apache.org/POM/4.0.0" \ + -t \ + --if "/x:project/x:groupId" \ + -v "/x:project/x:groupId" \ + --elif "/x:project/x:parent/x:groupId" \ + -v "/x:project/x:parent/x:groupId" \ + --else -o "" \ + pom.xml 2>/dev/null) + +cd "$WORKSPACE/target" +mv staged-site "$STREAM" +zip -r maven-site.zip "$STREAM" +lftools deploy nexus-zip "$NEXUS_URL" site "$MAVEN_GROUP_ID" maven-site.zip diff --git a/jjb/releng-macros.yaml b/jjb/releng-macros.yaml index fc4395df4..75ab2cfb6 100644 --- a/jjb/releng-macros.yaml +++ b/jjb/releng-macros.yaml @@ -302,6 +302,20 @@ healthy: 50 unhealthy: 40 +- builder: + # Deploys a maven site to Nexus using lftools nexus-zip command + name: opendaylight-infra-deploy-maven-site + builders: + - lf-provide-maven-settings: + global-settings-file: global-settings + settings-file: '{settings-file}' + - lf-infra-create-netrc: + server-id: opendaylight-site + - shell: !include-raw-escape: + - global-jjb/shell/lftools-install.sh + - opendaylight-infra-deploy-maven-site.sh + - lf-provide-maven-settings-cleanup + - builder: name: opendaylight-infra-stack # opendaylight-infra-stack.sh has a required variable {stack-template} that diff --git a/jjb/releng-templates-java.yaml b/jjb/releng-templates-java.yaml index ee30c6ba9..3cd9c2cb8 100644 --- a/jjb/releng-templates-java.yaml +++ b/jjb/releng-templates-java.yaml @@ -163,6 +163,10 @@ branch: '{branch}' refspec: 'refs/heads/{branch}' artifacts: '{archive-artifacts}' + - string: + name: STREAM + default: '{stream}' + description: "String representing release name" scm: - gerrit-trigger-scm: @@ -224,16 +228,8 @@ settings-type: cfp global-settings: 'global-settings' global-settings-type: cfp - - maven-target: - maven-version: 'mvn33' - pom: deploy-site.xml - goals: 'site:deploy -V -B -Dstream={stream}' - java-opts: - - '-Xmx2g' - settings: '{mvn-settings}' - settings-type: cfp - global-settings: 'global-settings' - global-settings-type: cfp + - opendaylight-infra-deploy-maven-site: + settings-file: '{mvn-settings}' reporters: - findbugs